Skip to content

ASN1_BIT_STRING_get_length

NAME

ASN1_BIT_STRING_get_length - ASN1_BIT_STRING accessors

SYNOPSIS

#include <openssl/asn1.h>

int ASN1_BIT_STRING_get_length(const ASN1_BIT_STRING *bitstr, size_t *length, int *unused_bits);

DESCRIPTION

ASN1_BIT_STRING_get_length() returns the number of octets in bitstr containing bit values in length and the number of unused bits in the last octet in unused_bits. The value returned in unused_bits is guaranteed to be between 0 and 7, inclusive.

RETURN VALUES

ASN1_BIT_STRING_get_length() returns 1 on success or 0 if the encoding of bitstr is internally inconsistent, or if one of bitstr, length, or unused_bits is NULL.

Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html.