Gets the PEM header name for this object type. Converts the class name to uppercase for use in PEM encoding.
Gets the PKI type name for this object (typically the class name). Used for PEM headers and debugging output.
Compares this PKI object with another for equality. Two objects are considered equal if their DER encodings are identical.
The other PKI object to compare with
true if the objects are equal, false otherwise
Parses this object as a different PKI type. Useful for converting between related PKI structures.
The target type to parse as
The target type constructor with parsing capabilities
A new instance of the target type
Converts this BitString to its ASN.1 representation.
The ASN.1 BIT STRING structure
Converts this PKI object to DER (Distinguished Encoding Rules) format.
The DER-encoded bytes of this object
Converts the BitString to a hexadecimal string representation. Each byte is represented as two lowercase hex digits.
The hexadecimal string (e.g., "0420abcd")
Returns a human-readable string representation of this object. By default, returns the same as toString(), but subclasses can override for more user-friendly output.
A human-readable string representation
Converts this PKI object to PEM (Privacy-Enhanced Mail) format.
A PEM-encoded string with appropriate headers
Returns the string representation of this BitString. Decodes the bytes as UTF-8 text.
The decoded string
Static
fromCreates a BitString from an ASN.1 BIT STRING structure.
The ASN.1 BIT STRING to parse
A new BitString instance
Represents an ASN.1 BIT STRING value.
A BIT STRING is used to represent sequences of bits. It's commonly used in PKI for public keys, signatures, and bit flags. The string can contain any number of bits, not necessarily a multiple of 8.
Asn
Example