PrivateKeyInfo

@Serializable
class PrivateKeyInfo(val version: Int, val privateKeyAlgorithm: AlgorithmIdentifier, val privateKey: ByteArray, val publicKey: BitArray? = null)(source)

OneAsymmetricKey as defined in RFC 5958 (extends PKCS#8 PrivateKeyInfo):

OneAsymmetricKey ::= SEQUENCE {
version Version,
privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
privateKey PrivateKey,
attributes [0] IMPLICIT Attributes OPTIONAL,
publicKey [1] IMPLICIT PublicKey OPTIONAL
}

Version ::= INTEGER { v1(0), v2(1) }
PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
PrivateKey ::= OCTET STRING
PublicKey ::= BIT STRING

Attributes is not yet supported:

Attributes ::= SET OF Attribute
Attribute ::= SEQUENCE {
type OBJECT IDENTIFIER,
values AttributeSetValue
}
AttributeSetValue ::= SET OF ANY

Constructors

Link copied to clipboard
constructor(version: Int, privateKeyAlgorithm: AlgorithmIdentifier, privateKey: ByteArray, publicKey: BitArray? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard