Advertisement
AnthonyCagliano

Untitled

Apr 13th, 2023
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. /******************************************************
  2. * PKCS#8 ASN.1 Specification
  3. * Use the API wrappers below to assist with easily decoding a PKCS#8
  4. * DER-encoded public key format
  5. */
  6. struct cryptx_pkcs8_asn1_obj {
  7. struct cryptx_asn1_obj publickeyinfo[3]; /**< holds object refs for algorithm id, NULL byte, and public key bit string */
  8. struct cryptx_asn1_obj publickey[2]; /**< holds object refs for public modulus and public exponent */
  9. };
  10.  
  11. static void cryptx_asn1_pkcs8_decode(void *data, size_t datalen, struct cryptx_pkcs8_asn1_obj *obj){
  12. cryptx_asn1_decode(data, datalen, obj->publickeyinfo, 3);
  13. cryptx_asn1_decode(obj->publickeyinfo[2].data, obj->publickeyinfo[2].len, obj->publickey, 2);
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement