Repository navigation
OnixLabs.Security.Cryptography.IEcdsaPrivateKey
Defines an ECDSA cryptographic private key.
| Namespace | OnixLabs.Security.Cryptography |
| Assembly | OnixLabs.Security.Cryptography.dll (NuGet) |
| Implements |
IPrivateKeyDerivable<EcdsaPublicKey>, IPrivateKeyImportable<EcdsaPrivateKey>, IPrivateKeyExportable, IBinaryConvertible
|
public interface IEcdsaPrivateKey :
IPrivateKeyDerivable<EcdsaPublicKey>,
IPrivateKeyImportable<EcdsaPrivateKey>,
IPrivateKeyExportable,
IBinaryConvertibleIEcdsaPrivateKey provides two families of signing operation: SignData hashes input data before signing (accepting raw bytes, a byte-range slice, a Stream, or an IBinaryConvertible); SignHash signs a pre-computed hash directly. Both families accept either a HashAlgorithm instance or a HashAlgorithmName string, and both accept an optional DSASignatureFormat to select between IEEE P1363 and DER encoding.
| Member | Returns | Description |
|---|---|---|
SignData(ReadOnlySpan<byte>, HashAlgorithm, DSASignatureFormat) |
byte[] |
Hashes and signs a span of bytes using a HashAlgorithm instance. |
SignData(ReadOnlySpan<byte>, int, int, HashAlgorithm, DSASignatureFormat) |
byte[] |
Hashes and signs a byte-range slice using a HashAlgorithm instance. |
SignData(Stream, HashAlgorithm, DSASignatureFormat) |
byte[] |
Hashes and signs a Stream using a HashAlgorithm instance. |
SignData(IBinaryConvertible, HashAlgorithm, DSASignatureFormat) |
byte[] |
Hashes and signs an IBinaryConvertible using a HashAlgorithm instance. |
SignData(ReadOnlySpan<byte>, HashAlgorithmName, DSASignatureFormat) |
byte[] |
Hashes and signs a span of bytes using a HashAlgorithmName. |
SignData(ReadOnlySpan<byte>, int, int, HashAlgorithmName, DSASignatureFormat) |
byte[] |
Hashes and signs a byte-range slice using a HashAlgorithmName. |
SignData(Stream, HashAlgorithmName, DSASignatureFormat) |
byte[] |
Hashes and signs a Stream using a HashAlgorithmName. |
SignData(IBinaryConvertible, HashAlgorithmName, DSASignatureFormat) |
byte[] |
Hashes and signs an IBinaryConvertible using a HashAlgorithmName. |
SignHash(Hash, DSASignatureFormat) |
byte[] |
Signs a pre-computed Hash. |
SignHash(ReadOnlySpan<byte>, DSASignatureFormat) |
byte[] |
Signs a pre-computed hash supplied as a raw span of bytes. |
byte[] SignData(ReadOnlySpan<byte> data, HashAlgorithm algorithm, DSASignatureFormat format = default);
byte[] SignData(ReadOnlySpan<byte> data, int offset, int count, HashAlgorithm algorithm, DSASignatureFormat format = default);
byte[] SignData(Stream data, HashAlgorithm algorithm, DSASignatureFormat format = default);
byte[] SignData(IBinaryConvertible data, HashAlgorithm algorithm, DSASignatureFormat format = default);
byte[] SignData(ReadOnlySpan<byte> data, HashAlgorithmName algorithm, DSASignatureFormat format = default);
byte[] SignData(ReadOnlySpan<byte> data, int offset, int count, HashAlgorithmName algorithm, DSASignatureFormat format = default);
byte[] SignData(Stream data, HashAlgorithmName algorithm, DSASignatureFormat format = default);
byte[] SignData(IBinaryConvertible data, HashAlgorithmName algorithm, DSASignatureFormat format = default);Hashes the specified input data and signs the resulting hash.
| Parameter | Type | Description |
|---|---|---|
data |
ReadOnlySpan<byte> / Stream / IBinaryConvertible
|
The input data to hash and sign. |
offset |
int |
(slice overloads) The offset into the span from which to begin reading. |
count |
int |
(slice overloads) The number of bytes to read from the span. |
algorithm |
HashAlgorithm or HashAlgorithmName
|
The hash algorithm used to hash the input data. |
format |
DSASignatureFormat |
The digital signature format (IEEE P1363 or DER). Defaults to DSASignatureFormat.IeeeP1363FixedFieldConcatenation. |
Returns — A byte[] containing the cryptographic digital signature.
byte[] SignHash(Hash hash, DSASignatureFormat format = default);
byte[] SignHash(ReadOnlySpan<byte> hash, DSASignatureFormat format = default);Signs a pre-computed hash value.
| Parameter | Type | Description |
|---|---|---|
hash |
Hash or ReadOnlySpan<byte>
|
The pre-computed hash to sign. |
format |
DSASignatureFormat |
The digital signature format. Defaults to DSASignatureFormat.IeeeP1363FixedFieldConcatenation. |
Returns — A byte[] containing the cryptographic digital signature.
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