본문 바로가기
카테고리 없음

gsjava openssl 1.1.1p x509 oid 방식 변경

by 철권 2023. 5. 26.
728x90

 X509_EXTENSION *ext;

>  ext = X509_get_ext(X509, n);
// data = ext->value->data;

    /* ext->object */
    ASN1_OBJECT *oid = X509_EXTENSION_get_object(ext);

    /* ext->value, formally ASN1_OCTET_STRING, same as ASN1_STRING */
    ASN1_OCTET_STRING *value = X509_EXTENSION_get_data(ext);

    /* ASN1 type, e.g. V_ASN1_UTF8STRING */
    int type = ASN1_STRING_type(value);

    /* Data length */
    int length = ASN1_STRING_length(value);

    /* Data content, generally not a NUL-terminated C string */
    const unsigned char *data = ASN1_STRING_get0_data(value);

728x90
반응형