Interface IOpenPgp
Provides access to an encryption/signature system compatible with the OpenPGP standard.
Namespace: ZeroInstall.Store.Trust
Assembly: ZeroInstall.Store.dll
Syntax
public interface IOpenPgp
Methods
ExportKey(IKeyIDContainer)
Exports the public key for a specific key in the keyring.
Declaration
string ExportKey(IKeyIDContainer keyIDContainer)
Parameters
Type | Name | Description |
---|---|---|
IKeyIDContainer | keyIDContainer | An object containing the key ID of the public key to export. |
Returns
Type | Description |
---|---|
String | The public key in ASCII Armored format. Always uses Unix-style linebreaks. |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | The specified |
See Also
ImportKey(ArraySegment<Byte>)
Imports a public key into the keyring.
Declaration
void ImportKey(ArraySegment<byte> data)
Parameters
Type | Name | Description |
---|---|---|
ArraySegment<Byte> | data | The public key in binary or ASCII Armored format. |
Exceptions
Type | Condition |
---|---|
InvalidDataException |
|
See Also
ListSecretKeys()
Returns a list of secret keys in the keyring.
Declaration
IEnumerable<OpenPgpSecretKey> ListSecretKeys()
Returns
Type | Description |
---|---|
IEnumerable<OpenPgpSecretKey> |
See Also
Sign(ArraySegment<Byte>, OpenPgpSecretKey, String)
Creates a detached OpenPGP signature using a specific secret key.
Declaration
byte[] Sign(ArraySegment<byte> data, OpenPgpSecretKey secretKey, string passphrase = null)
Parameters
Type | Name | Description |
---|---|---|
ArraySegment<Byte> | data | The data to sign. |
OpenPgpSecretKey | secretKey | The secret key to use for signing. |
String | passphrase | The passphrase to use to unlock the secret key. |
Returns
Type | Description |
---|---|
Byte[] | The signature in binary format. |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | The specified |
WrongPassphraseException |
|
See Also
Verify(ArraySegment<Byte>, Byte[])
Verifies a detached OpenPGP signature.
Declaration
IEnumerable<OpenPgpSignature> Verify(ArraySegment<byte> data, byte[] signature)
Parameters
Type | Name | Description |
---|---|---|
ArraySegment<Byte> | data | The data the signature is for. |
Byte[] | signature | The signature in binary format. |
Returns
Type | Description |
---|---|
IEnumerable<OpenPgpSignature> | A list of signatures found, both valid and invalid. MissingKeySignature results indicate you need to use ImportKey(ArraySegment<Byte>). |
Exceptions
Type | Condition |
---|---|
InvalidDataException |
|