Hi,
There are a couple of issues here with the demo.
First issue, 1.2.840.113549.1.5.13 is the OID for pkcs5PBKDF2, meaning that a password has been used to derive a key and encrypt the private key with OID 2.16.840.1.101.3.4.1.42, i.e., aes256 in CBC mode.
The demo doesn't address this scenario (password for private key) and calls 'ExtractRSAPrivateKey'.
If you look at the code in ASN1Core ca. line 450, you can find:
if Password <> '' then begin
KeyStr := ExtractEncryptedPrivateKey(KeyStr);
end;
Because 'password' is empty, the function doesn't call TASN1.ExtractEncryptedPrivateKey(KeyStr: string) and then doesn't recognized the OID that is processed in this function (see around line 300).
Second issue, I need to add a property in TAdES to set password values for imported keys.
Note that for PFX certificates, the user is asked for a password with 'FromPFXAskPassword' at line 4909 of the demo and no 'password' property is used.