Repository navigation
OnixLabs.Security.Cryptography.IPrivateKeyPemImportable
Defines a cryptographic private key that can be imported from RFC 7468 PEM-encoded data.
| Namespace | OnixLabs.Security.Cryptography |
| Assembly | OnixLabs.Security.Cryptography.dll (NuGet) |
public interface IPrivateKeyPemImportable<out T> where T : PrivateKey| Parameter | Description |
|---|---|
T |
The type of PrivateKey returned by the static import members. Declared covariant (out T). Must derive from PrivateKey. |
IPrivateKeyPemImportable<T> defines the PEM import contract. The PEM label in the input data determines the encoding format — for example, PKCS #8 PRIVATE KEY, SEC1 EC PRIVATE KEY, or PKCS #1 RSA PRIVATE KEY. The two-argument overloads additionally decrypt an ENCRYPTED PRIVATE KEY PEM block using the supplied password. All members are declared static abstract and are called on the concrete type.
This interface is composed into IPrivateKeyImportable<T> and is also implemented directly by IEddsaPrivateKey.
| Member | Returns | Description |
|---|---|---|
ImportPem(ReadOnlySpan<char>) |
T |
Imports from unencrypted RFC 7468 PEM-encoded text. |
ImportPem(ReadOnlySpan<char>, ReadOnlySpan<char>) |
T |
Imports from encrypted PEM using a char-based password. |
ImportPem(ReadOnlySpan<char>, ReadOnlySpan<byte>) |
T |
Imports from encrypted PEM using a byte-based password. |
public static abstract T ImportPem(ReadOnlySpan<char> data);
public static abstract T ImportPem(ReadOnlySpan<char> data, ReadOnlySpan<char> password);
public static abstract T ImportPem(ReadOnlySpan<char> data, ReadOnlySpan<byte> password);Imports a cryptographic private key from RFC 7468 PEM-encoded text. The PEM label determines the encoding format (for example, PKCS #8 PRIVATE KEY, SEC1 EC PRIVATE KEY, or PKCS #1 RSA PRIVATE KEY). The two-argument overloads additionally decrypt an ENCRYPTED PRIVATE KEY PEM block.
| Parameter | Type | Description |
|---|---|---|
data |
ReadOnlySpan<char> |
The PEM-encoded private key data to import. |
password |
ReadOnlySpan<char> or ReadOnlySpan<byte>
|
(encrypted overloads) The password required for password-based decryption. |
Returns — A new T instance containing the imported private key.
ONIXLabs .NET Library · Repository · NuGet · License (Apache-2.0)
Copyright © ONIXLabs 2020. Licensed under the Apache License, Version 2.0.
- Enumeration<T>
- Optional<T>
- OptionalEqualityComparer<T>
- OptionalExtensions
- Result
- Result<T>
- ResultEqualityComparer<T>
- ResultExtensions
- Specification<T>
- Preconditions
- IValueEquatable<T>
- IValueComparable<T>
- IBinaryConvertible
- ISpanBinaryConvertible
- IMemoryBinaryConvertible
- ArrayExtensions
- ComparableExtensions
- DateTimeExtensions
- ISpanParsableExtensions
- ObjectExtensions
- RandomExtensions
- ReadOnlySequenceExtensions
- ReadOnlySpanExtensions
- StringExtensions
- Base16
- Base32
- Base58
- Base64
- IBaseCodec
- IBaseValue
- IBaseValue<T>
- Base16Codec
- Base32Codec
- Base58Codec
- Base64Codec
- Base16FormatProvider
- Base32FormatProvider
- Base58FormatProvider
- Base64FormatProvider
- EncodingExtensions
- ReadOnlySpanExtensions
- StringBuilderExtensions
- BigDecimal
- BigDecimalEqualityComparer
- BigDecimalOrdinalityComparer
- NumberInfo
- NumberInfoEqualityComparer
- NumberInfoOrdinalityComparer
- Int256
- Int512
- UInt256
- UInt512
- Float128
- Float256
- GenericMath
- NumericsExtensions
- ConversionMode
- ScaleMode
- Hash
- NamedHash
- Sha3
- Sha3Hash224
- Sha3Hash256
- Sha3Hash384
- Sha3Hash512
- Sha3Shake128
- Sha3Shake256
- MerkleTree
- MerkleTree<T>
- PrivateKey
- PublicKey
- NamedPrivateKey
- NamedPublicKey
- EcdhPrivateKey
- EcdhPublicKey
- EcdsaPrivateKey
- EcdsaPublicKey
- EddsaPrivateKey
- EddsaPublicKey
- RsaPrivateKey
- RsaPublicKey
- DigitalSignature
- DigitalSignatureAndPublicKey
- Salt
- Secret
- ICryptoPrimitive<T>
- IHashable
- IEcdhPrivateKey
- IEcdsaPrivateKey
- IEddsaPrivateKey
- IRsaPrivateKey
- IPrivateKeyDerivable<T>
- IPrivateKeyExportable
- IPrivateKeyImportable<T>
- IPrivateKeyPemImportable<T>
- IPrivateKeyPkcs8Exportable
- IPrivateKeyPkcs8Importable<T>
- IPrivateKeyPkcs8PemExportable
- IPrivateKeyRawExportable
- IPrivateKeyRawImportable<T>
- IPrivateKeyRawPemExportable
- IEcdhPublicKey
- IEcdsaPublicKey
- IEddsaPublicKey
- IRsaPublicKey
- IPublicKeyExportable
- IPublicKeyImportable<T>
- IPublicKeyPemExportable
- IPublicKeyPemImportable<T>
- IPublicKeyRawExportable
- IPublicKeyRawImportable<T>
- HashAlgorithmExtensions
- ReadOnlySpanExtensions