Class AccountKey
Represents a JSON Web Signature (JWS) key pair.
Inheritance
AccountKey
Namespace: Certes.Jws
Assembly: Certes.dll
Syntax
public class AccountKey : IAccountKey
Constructors
| Edit this page View SourceAccountKey(KeyAlgorithm)
Initializes a new instance of the AccountKey class.
Declaration
public AccountKey(KeyAlgorithm algorithm = KeyAlgorithm.ES256)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyAlgorithm | algorithm | The JWS signature algorithm. |
AccountKey(KeyInfo)
Initializes a new instance of the AccountKey class.
Declaration
public AccountKey(KeyInfo keyInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyInfo | keyInfo | The key information. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | keyInfo |
| NotSupportedException | If the provided key is not one of the supported KeyAlgorithm. |
Properties
| Edit this page View SourceAlgorithm
Gets the signing algorithm.
Declaration
public KeyAlgorithm Algorithm { get; }
Property Value
| Type | Description |
|---|---|
| KeyAlgorithm | The signing algorithm. |
JsonWebKey
Gets the JSON web key.
Declaration
public JsonWebKey JsonWebKey { get; }
Property Value
| Type | Description |
|---|---|
| JsonWebKey | The JSON web key. |
SignatureKey
Gets the signature key.
Declaration
public IKey SignatureKey { get; }
Property Value
| Type | Description |
|---|---|
| IKey | The signature key. |
Methods
| Edit this page View SourceComputeHash(byte[])
Computes the hash for given data.
Declaration
public byte[] ComputeHash(byte[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The data. |
Returns
| Type | Description |
|---|---|
| byte[] | The hash. |
Export()
Exports the key pair.
Declaration
public KeyInfo Export()
Returns
| Type | Description |
|---|---|
| KeyInfo | The key pair. |
SignData(byte[])
Signs the data.
Declaration
public byte[] SignData(byte[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The data. |
Returns
| Type | Description |
|---|---|
| byte[] | The signature. |