Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

OpenSSL::ASN1.decode

OpenSSL::ASN1.decode(der) → ASN1Data

Decodes a BER- or DER-encoded value and creates an ASN1Data instance. der may be a String or any object that features a .to_der method transforming it into a BER-/DER-encoded String+

Example

Example
der = File.binread('asn1data')
asn1 = OpenSSL::ASN1.decode(der)
See also .decode_all .traverse also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0