Re: get data from X509_EXTENSION in openSSL 1.1.1.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: prudvi raj <rajprudvi98@xxxxxxxxx>
> To: openssl-users@xxxxxxxxxxx
> Date: 07/10/2020 07:55 AM
> Subject: [EXTERNAL] get data from X509_EXTENSION in openSSL 1.1.1.
> Sent by: "openssl-users" <openssl-users-bounces@xxxxxxxxxxx>
>
> Hi All,

>
> we are upgrading our codebase to 1.1.1 from 1.0.2k.Here's a code
> snippet causing error :

>
>  ext = X509_get_ext(X509, n);

>  data = "">
>
> How do i get the data value from X509_EXTENSION object.

> since forward declarations are not allowed (compiler error) & i
> couldn't find a suitable 'getter' function.

> Can someone please help me out in resolving this issue.??

This may work:

ASN1_BIT_STRING *keyUsage =
X509_get_ext_d2i(X509Certificate, NID_key_usage,
   NULL, NULL);
uint8_t bitmap = bitmap = keyUsage->data[0];
keyEncipherment = bitmap & (1<<5); /* bit 2 little endian */


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux