CryptoPrivateKey

PKCS#8 Representation of a private key structure as per RFC 5208 Equality checks are performed wrt. cryptographic properties.

Inheritors

Types

Link copied to clipboard
sealed class EC : CryptoPrivateKey.Impl

SEC1 Elliptic Curve Private Key Structure as per RFC 5915 augmented with optional attributes. Attributes are never SEC1 encoded, but are relevant when PKCS#8-encoding a private key.

Link copied to clipboard
Link copied to clipboard
sealed class Impl : CryptoPrivateKey
Link copied to clipboard
class RSA constructor(val publicKey: CryptoPublicKey.RSA, val privateKey: BigInteger, val prime1: BigInteger, val prime2: BigInteger, val prime1exponent: BigInteger, val prime2exponent: BigInteger, val crtCoefficient: BigInteger, val otherPrimeInfos: List<CryptoPrivateKey.RSA.PrimeInfo>?, val attributes: List<Asn1Element>? = null) : CryptoPrivateKey.Impl, CryptoPrivateKey.WithPublicKey<CryptoPublicKey.RSA>

PKCS#1 RSA Private key representation as per RFC 8017 augmented with optional attributes. Attributes are never PKCS#1 encoded, but are relevant when PKCS#8-encoding a private key.

Link copied to clipboard

Properties

Link copied to clipboard

Encodes this private key into a PKCS#8-encoded private key. This is the default.

Link copied to clipboard
abstract val attributes: List<Asn1Element>?

optional attributes relevant when PKCS#8-encoding a private key

Link copied to clipboard

Encapsulation boundary string. Will be automatically fenced.

Link copied to clipboard
abstract val oid: ObjectIdentifier

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun encodeToDerSafe(): KmmResult<ByteArray>
Link copied to clipboard
fun PemEncodable<*>.encodeToPEM(): KmmResult<String>

Encodes this PemEncodable into a PEM-encoded string

Link copied to clipboard
abstract fun encodeToTlv(): Asn1Sequence
Link copied to clipboard
Link copied to clipboard
open fun encodeToTlvSafe(): KmmResult<Asn1Sequence>
Link copied to clipboard
open infix fun withImplicitTag(tagValue: ULong): Asn1Element