BIO_printf with ASN1_BIT_STRING and ASN1_INTEGER?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

BIO_printf with ASN1_BIT_STRING and ASN1_INTEGER?

Opa114
Hi there,

i have to print out some data, which is an ASN1_BIT_STRING and an ASN1_INTEGER with BIO_printf. For GENERAL_NAME for example there a predefined functions i can use like this: GENERAL_NAME_print(bp, GENERAL_NAME_VAR) <= 0

But for ASN1_INTGER and ASN1_BIT_STRING i haven't found any predefined function like ASN1_INTEGER_PRINT or something similiar i can use. So can someone tell me how i print out these two data types with BIO_printf in the correct and actual way?

thanks a lot.

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: BIO_printf with ASN1_BIT_STRING and ASN1_INTEGER?

Dave Coombs
Hi,

You can use i2a_ASN1_INTEGER() to print an ASN1_INTEGER to a BIO.

  -Dave


On Oct 16, 2018, at 05:37, Opa114 <[hidden email]> wrote:

Hi there,

i have to print out some data, which is an ASN1_BIT_STRING and an ASN1_INTEGER with BIO_printf. For GENERAL_NAME for example there a predefined functions i can use like this: GENERAL_NAME_print(bp, GENERAL_NAME_VAR) <= 0

But for ASN1_INTGER and ASN1_BIT_STRING i haven't found any predefined function like ASN1_INTEGER_PRINT or something similiar i can use. So can someone tell me how i print out these two data types with BIO_printf in the correct and actual way?

thanks a lot.
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users

smime.p7s (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: BIO_printf with ASN1_BIT_STRING and ASN1_INTEGER?

Matthias Ballreich
Hi,

thanks for this - what about the ASN1_BIT_STRING? Is there such a predefined function?

Von: openssl-users <[hidden email]> im Auftrag von Dave Coombs <[hidden email]>
Gesendet: Dienstag, 16. Oktober 2018 15:17 Uhr
An: [hidden email]
Betreff: Re: [openssl-users] BIO_printf with ASN1_BIT_STRING and ASN1_INTEGER?
 
Hi,

You can use i2a_ASN1_INTEGER() to print an ASN1_INTEGER to a BIO.

  -Dave


On Oct 16, 2018, at 05:37, Opa114 <[hidden email]> wrote:

Hi there,

i have to print out some data, which is an ASN1_BIT_STRING and an ASN1_INTEGER with BIO_printf. For GENERAL_NAME for example there a predefined functions i can use like this: GENERAL_NAME_print(bp, GENERAL_NAME_VAR) <= 0

But for ASN1_INTGER and ASN1_BIT_STRING i haven't found any predefined function like ASN1_INTEGER_PRINT or something similiar i can use. So can someone tell me how i print out these two data types with BIO_printf in the correct and actual way?

thanks a lot.
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: BIO_printf with ASN1_BIT_STRING and ASN1_INTEGER?

Opa114
In reply to this post by Dave Coombs
Hi,

thanks for this - what about the ASN1_BIT_STRING? Is there such a predefined function?


Von: openssl-users <[hidden email]> im Auftrag von Dave Coombs <[hidden email]>
Gesendet: Dienstag, 16. Oktober 2018 15:17 Uhr
An: [hidden email]
Betreff: Re: [openssl-users] BIO_printf with ASN1_BIT_STRING and ASN1_INTEGER?
 
Hi,

You can use i2a_ASN1_INTEGER() to print an ASN1_INTEGER to a BIO.

  -Dave


On Oct 16, 2018, at 05:37, Opa114 <[hidden email]> wrote:

Hi there,

i have to print out some data, which is an ASN1_BIT_STRING and an ASN1_INTEGER with BIO_printf. For GENERAL_NAME for example there a predefined functions i can use like this: GENERAL_NAME_print(bp, GENERAL_NAME_VAR) <= 0

But for ASN1_INTGER and ASN1_BIT_STRING i haven't found any predefined function like ASN1_INTEGER_PRINT or something similiar i can use. So can someone tell me how i print out these two data types with BIO_printf in the correct and actual way?

thanks a lot.
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: BIO_printf with ASN1_BIT_STRING and ASN1_INTEGER?

Dave Coombs
Depends what you want it to print, I guess...  ASN1_STRING_print_ex() can print any ASN1_STRING (including an ASN1_BIT_STRING) but it'll come out binary packed.  If you want to do anything fancier like print individual bit values in a more human-readable way, you'll have to do it yourself, as far as I know.

  -Dave


On Oct 16, 2018, at 10:32, Opa114 <[hidden email]> wrote:

Hi,

thanks for this - what about the ASN1_BIT_STRING? Is there such a predefined function?


Von: openssl-users <[hidden email]> im Auftrag von Dave Coombs <[hidden email]>
Gesendet: Dienstag, 16. Oktober 2018 15:17 Uhr
An: [hidden email]
Betreff: Re: [openssl-users] BIO_printf with ASN1_BIT_STRING and ASN1_INTEGER?
 
Hi,

You can use i2a_ASN1_INTEGER() to print an ASN1_INTEGER to a BIO.

  -Dave


On Oct 16, 2018, at 05:37, Opa114 <[hidden email]> wrote:

Hi there,

i have to print out some data, which is an ASN1_BIT_STRING and an ASN1_INTEGER with BIO_printf. For GENERAL_NAME for example there a predefined functions i can use like this: GENERAL_NAME_print(bp, GENERAL_NAME_VAR) <= 0

But for ASN1_INTGER and ASN1_BIT_STRING i haven't found any predefined function like ASN1_INTEGER_PRINT or something similiar i can use. So can someone tell me how i print out these two data types with BIO_printf in the correct and actual way?

thanks a lot.
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users