struct Matter::Crypto::MatterCertificate

Overview

Matter Certificate TLV structure See Matter spec section 6.5.2 "Matter Certificate Encoding"

Included Modules

Defined in:

matter/crypto/certificate.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(serial_number : Bytes, signature_algorithm : UInt8, issuer : DNAttributes, not_before : UInt32, not_after : UInt32, subject : DNAttributes, public_key_algorithm : UInt8, elliptic_curve_id : UInt8, ec_public_key : Bytes, signature : Bytes, extensions : TLV::Any | Nil = nil) #

[View source]
def self.new(any : TLV::Any) #

[View source]

Class Method Detail

def self.from_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::LittleEndian) #

[View source]
def self.from_slice(bytes : Bytes) #

[View source]
def self.from_tlv(any : TLV::Any) #

[View source]

Instance Method Detail

def ec_public_key : Bytes #

Tag 9: EC public key (octet string, 65 bytes for uncompressed P-256)


[View source]
def ec_public_key=(ec_public_key : Bytes) #

Tag 9: EC public key (octet string, 65 bytes for uncompressed P-256)


[View source]
def elliptic_curve_id : UInt8 #

Tag 8: Elliptic curve ID (unsigned int) 1 = prime256v1 (P-256)


[View source]
def elliptic_curve_id=(elliptic_curve_id : UInt8) #

Tag 8: Elliptic curve ID (unsigned int) 1 = prime256v1 (P-256)


[View source]
def extensions : TLV::Any | Nil #

Tag 10: Extensions (list)


[View source]
def extensions=(extensions : TLV::Any | Nil) #

Tag 10: Extensions (list)


[View source]
def fabric_id : UInt64 | Nil #

Extract fabric ID from subject DN


[View source]
def icac? : Bool #

Check if this is an ICAC (has icac_id)


[View source]
def issuer : DNAttributes #

Tag 3: Issuer DN (list of DN attributes)


[View source]
def issuer=(issuer : DNAttributes) #

Tag 3: Issuer DN (list of DN attributes)


[View source]
def noc? : Bool #

Check if this is a NOC (has both fabric_id and node_id)


[View source]
def node_id : UInt64 | Nil #

Extract node ID from subject DN


[View source]
def not_after : UInt32 #

Tag 5: Not After (unsigned int, Matter epoch seconds)


[View source]
def not_after=(not_after : UInt32) #

Tag 5: Not After (unsigned int, Matter epoch seconds)


[View source]
def not_before : UInt32 #

Tag 4: Not Before (unsigned int, Matter epoch seconds)


[View source]
def not_before=(not_before : UInt32) #

Tag 4: Not Before (unsigned int, Matter epoch seconds)


[View source]
def public_key_algorithm : UInt8 #

Tag 7: Public key algorithm (unsigned int) 1 = EC public key


[View source]
def public_key_algorithm=(public_key_algorithm : UInt8) #

Tag 7: Public key algorithm (unsigned int) 1 = EC public key


[View source]
def root_ca? : Bool #

Check if this is a root CA (has rcac_id)


[View source]
def serial_number : Bytes #

Tag 1: Serial number (octet string, 1-20 bytes)


[View source]
def serial_number=(serial_number : Bytes) #

Tag 1: Serial number (octet string, 1-20 bytes)


[View source]
def signature : Bytes #

Tag 11: Signature (octet string, 64 bytes for P-256 ECDSA)


[View source]
def signature=(signature : Bytes) #

Tag 11: Signature (octet string, 64 bytes for P-256 ECDSA)


[View source]
def signature_algorithm : UInt8 #

Tag 2: Signature algorithm (unsigned int) 1 = ECDSA with SHA256


[View source]
def signature_algorithm=(signature_algorithm : UInt8) #

Tag 2: Signature algorithm (unsigned int) 1 = ECDSA with SHA256


[View source]
def subject : DNAttributes #

Tag 6: Subject DN (list of DN attributes)


[View source]
def subject=(subject : DNAttributes) #

Tag 6: Subject DN (list of DN attributes)


[View source]
def to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::LittleEndian) : Nil #

[View source]
def to_slice : Bytes #

[View source]
def to_tlv(outer_tag : Nil | UInt8 | Tuple(UInt16, UInt16) | Tuple(UInt16, UInt16, UInt16) = nil) : TLV::Any #

[View source]