module Matter::Codec::DERCodec
Defined in:
matter/codec/der_codec.cr
Constant Summary
-
AuthorityKeyIdentifier_X509 =
->(identifier : Slice(UInt8)) do
(Object.new("551d23", {"value" => Base.encode({"id" => (ContextTaggedSlice.new(0, identifier)).value})})).value
end
-
BasicConstraints_X509 =
->(constraints : Value) do
(Object.new("551d13", {"critical" => true, "value" => Base.encode(constraints)})).value
end
-
BITS_PADDING =
"_padding"
-
BYTES_KEY =
"_bytes"
-
CONSTRUCTED =
32
-
EcdsaWithSHA256_X962 =
-> do
(Object.new("2A8648CE3D040302")).value
end
-
ELEMENTS_KEY =
"_elements"
-
ExtendedKeyUsage_X509 =
->(client_auth : Bool, server_auth : Bool) do
(Object.new("551d25", {"critical" => true, "value" => Base.encode({"client" => client_auth ? (ObjectId.new("2b06010505070302")).value : nil, "server" => server_auth ? (ObjectId.new("2b06010505070301")).value : nil} of String => Value)})).value
end
-
KeyUsage_Signature_ContentCommited_X509 =
-> do
(Object.new("551d0f", {"critical" => true, "value" => Base.encode((ByteArray.new(Slice(UInt8).new(1, (3 << 1).to_u8), 1)).value)} of String => Value)).value
end
-
KeyUsage_Signature_X509 =
-> do
(Object.new("551d0f", {"critical" => true.as(Value), "value" => Base.encode((ByteArray.new(Slice(UInt8).new(1, (3 << 1).to_u8), 1)).value)} of String => Value)).value
end
-
OBJECT_ID_KEY =
"_objectId"
-
OrganisationName_X520 =
->(name : String) do
[(Object.new("55040A", {"name" => name})).value] of Value
end
-
Pkcs7Data =
->(data : Value) do
(Object.new("2A864886F70D010701", {"value" => (ContextTagged.new(0, data)).value})).value
end
-
Pkcs7SignedData =
->(data : Value) do
(Object.new("2a864886f70d010702", {"value" => (ContextTagged.new(0, data)).value})).value
end
-
PublicKeyEcPrime256v1_X962 =
->(key : Slice(UInt8)) do
value = {"type" => {"algorithm" => (ObjectId.new("2A8648CE3D0201")).value.as(Matter::Codec::DERCodec::Value), "curve" => (ObjectId.new("2A8648CE3D030107")).value.as(Matter::Codec::DERCodec::Value)}, "bytes" => (ByteArray.new(key)).value.as(Matter::Codec::DERCodec::Value)} of String => Value
value.as(Matter::Codec::DERCodec::Value)
end
-
SHA256_CMS =
-> do
(Object.new("608648016503040201")).value
end
-
SubjectKeyIdentifier_X509 =
->(identifier : Slice(UInt8)) do
(Object.new("551d0e", {"value" => Base.encode(identifier)})).value
end
-
TAG_ID_KEY =
"_tag"