Repository navigation
OnixLabs.Security.Cryptography.IPrivateKeyPkcs8Importable
Defines a cryptographic private key that can be imported from PKCS #8 binary form.
| Namespace | OnixLabs.Security.Cryptography |
| Assembly | OnixLabs.Security.Cryptography.dll (NuGet) |
public interface IPrivateKeyPkcs8Importable<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. |
IPrivateKeyPkcs8Importable<T> defines the PKCS #8 binary import contract. Unencrypted overloads accept a raw PKCS #8 DER buffer; encrypted overloads additionally accept a password to decrypt an EncryptedPrivateKeyInfo structure. Overloads that include an out int bytesRead parameter report how many bytes were consumed from the input span, which is useful when importing from a larger buffer. 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 |
|---|---|---|
ImportPkcs8(ReadOnlySpan<byte>) |
T |
Imports unencrypted PKCS #8 from a span. |
ImportPkcs8(ReadOnlySpan<byte>, out int) |
T |
Imports unencrypted PKCS #8 from a span; reports bytes read. |
ImportPkcs8(ReadOnlySpan<byte>, ReadOnlySpan<char>) |
T |
Imports encrypted PKCS #8 from a span using a char-based password. |
ImportPkcs8(ReadOnlySpan<byte>, ReadOnlySpan<char>, out int) |
T |
Imports encrypted PKCS #8 from a span using a char-based password; reports bytes read. |
ImportPkcs8(ReadOnlySpan<byte>, ReadOnlySpan<byte>) |
T |
Imports encrypted PKCS #8 from a span using a byte-based password. |
ImportPkcs8(ReadOnlySpan<byte>, ReadOnlySpan<byte>, out int) |
T |
Imports encrypted PKCS #8 from a span using a byte-based password; reports bytes read. |
ImportPkcs8(IBinaryConvertible) |
T |
Imports unencrypted PKCS #8 from an IBinaryConvertible. |
ImportPkcs8(IBinaryConvertible, out int) |
T |
Imports unencrypted PKCS #8 from an IBinaryConvertible; reports bytes read. |
ImportPkcs8(IBinaryConvertible, ReadOnlySpan<char>) |
T |
Imports encrypted PKCS #8 from an IBinaryConvertible using a char-based password. |
ImportPkcs8(IBinaryConvertible, ReadOnlySpan<char>, out int) |
T |
Imports encrypted PKCS #8 from an IBinaryConvertible using a char-based password; reports bytes read. |
ImportPkcs8(IBinaryConvertible, ReadOnlySpan<byte>) |
T |
Imports encrypted PKCS #8 from an IBinaryConvertible using a byte-based password. |
ImportPkcs8(IBinaryConvertible, ReadOnlySpan<byte>, out int) |
T |
Imports encrypted PKCS #8 from an IBinaryConvertible using a byte-based password; reports bytes read. |
public static abstract T ImportPkcs8(ReadOnlySpan<byte> data);
public static abstract T ImportPkcs8(ReadOnlySpan<byte> data, out int bytesRead);
public static abstract T ImportPkcs8(ReadOnlySpan<byte> data, ReadOnlySpan<char> password);
public static abstract T ImportPkcs8(ReadOnlySpan<byte> data, ReadOnlySpan<char> password, out int bytesRead);
public static abstract T ImportPkcs8(ReadOnlySpan<byte> data, ReadOnlySpan<byte> password);
public static abstract T ImportPkcs8(ReadOnlySpan<byte> data, ReadOnlySpan<byte> password, out int bytesRead);
public static abstract T ImportPkcs8(IBinaryConvertible data);
public static abstract T ImportPkcs8(IBinaryConvertible data, out int bytesRead);
public static abstract T ImportPkcs8(IBinaryConvertible data, ReadOnlySpan<char> password);
public static abstract T ImportPkcs8(IBinaryConvertible data, ReadOnlySpan<char> password, out int bytesRead);
public static abstract T ImportPkcs8(IBinaryConvertible data, ReadOnlySpan<byte> password);
public static abstract T ImportPkcs8(IBinaryConvertible data, ReadOnlySpan<byte> password, out int bytesRead);Imports a cryptographic private key from PKCS #8 DER-encoded data.
| Parameter | Type | Description |
|---|---|---|
data |
ReadOnlySpan<byte> or IBinaryConvertible
|
The PKCS #8 DER-encoded key data to import. |
password |
ReadOnlySpan<char> or ReadOnlySpan<byte>
|
(encrypted overloads) The password required for password-based decryption. |
bytesRead |
out int |
(bytesRead overloads) Receives the number of bytes consumed from data. |
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