Beryl::Certificates::SubjectPublicKeyInfo
A SubjectPublicKeyInfo (RFC 5280 §4.1.2.7): an algorithm identifier and the key bytes.
Reading one checks only its DER structure, as OpenSSL's d2i_X509 and
Go's parser do. verification_key decodes the key the first time it is
asked for and returns nil for a key Beryl does not use, with the
reason in unusable_key_reason:
- RSA (
rsaEncryptionwith NULL parameters): a modulus of 2,048 to 8,192 bits whose size is a multiple of 8 (CA/Browser Forum baseline requirements §6.1.5), an odd public exponent from 3 to 2^32 - 1; - EC (
id-ecPublicKey): the named curves P-256 and P-384 (RFC 5480); explicit curve parameters are refused (baseline requirements §7.1.3.1.2); - Ed25519 (RFC 8410), with absent parameters.
Constructors
Reads a DER SubjectPublicKeyInfo on its own, as a PUBLIC KEY PEM
block or Wycheproof's publicKeyDer holds it.
new(algorithm : Beryl::Encoding::DistinguishedEncodingRules::ObjectIdentifier, parameters : Beryl::Encoding::DistinguishedEncodingRules::Element | Nil, key_bytes : Slice(UInt8), encoded : Slice(UInt8))
Sourceread(reader : Encoding::DER::Reader) : SubjectPublicKeyInfo
Reads a SubjectPublicKeyInfo from reader.
Instance methods
algorithm
Source