Home Forums ActiveX components Xceed Encryption for ActiveX I already have a private/public key. Can I use it with your library?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #43018 |

    The only asymetrical encryption algorithm supported by Xceed Encryption Library is RSA-OAEP which is part of the latest PKCS#1 document. If you have in your possession a RSA private or a public key that have not been created by Xceed Encryption Library it may or may not be compatible with the library, depending if it conforms to the OAEP standard or not.

    The key blob uses the ASN.1 notation with DER encoding, as described in the RSA PKCS #1 standard : ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1.pdf

    A good way to know if the key is compatible is to try it! Assign the PrivateKey property or the PublicKey property to a XceedRSAEncryptionMethod object and try to, respectively, Decrypt or Encrypt a bunch of data. If the key is invalid you will have a eerInvalidKeyPair (0x8004500E) error code.

    A more user-friendly way to guess if a key is OAEP is by checking the first byte of either the Private or Public key. If it’s ASCII 30 (in hexadecimal) there’s a chance that the key will be accepted by Xceed Encryption Library. This is due to the DER encoding that we are using. If it’s not “30” then you can be sure that the key is not according to the OAEP format and will be rejected.

    Imported from legacy forums. Posted by Xceed admin (had 781 views)

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.