Zero Install .NET API 2.20.0
ZeroInstall.Store.Trust.IOpenPgp Interface Reference

Provides access to an encryption/signature system compatible with the OpenPGP standard. More...

Inheritance diagram for ZeroInstall.Store.Trust.IOpenPgp:
ZeroInstall.Store.Trust.BouncyCastle ZeroInstall.Store.Trust.GnuPG

Public Member Functions

IEnumerable< OpenPgpSignatureVerify (ArraySegment< byte > data, byte[] signature)
 Verifies a detached OpenPGP signature. More...
 
byte[] Sign (ArraySegment< byte > data, OpenPgpSecretKey secretKey, string? passphrase=null)
 Creates a detached OpenPGP signature using a specific secret key. More...
 
void ImportKey (ArraySegment< byte > data)
 Imports a public key into the keyring. More...
 
string ExportKey (IKeyIDContainer keyIDContainer)
 Exports the public key for a specific key in the keyring. More...
 
IEnumerable< OpenPgpSecretKeyListSecretKeys ()
 Returns a list of secret keys in the keyring. More...
 

Detailed Description

Provides access to an encryption/signature system compatible with the OpenPGP standard.

Member Function Documentation

◆ ExportKey()

string ZeroInstall.Store.Trust.IOpenPgp.ExportKey ( IKeyIDContainer  keyIDContainer)

Exports the public key for a specific key in the keyring.

Parameters
keyIDContainerAn object containing the key ID of the public key to export.
Returns
The public key in ASCII Armored format. Always uses Unix-style linebreaks.
Exceptions
KeyNotFoundExceptionThe specified keyIDContainer could not be found in the keyring.
See also
ImportKey

Implemented in ZeroInstall.Store.Trust.BouncyCastle, and ZeroInstall.Store.Trust.GnuPG.

◆ ImportKey()

void ZeroInstall.Store.Trust.IOpenPgp.ImportKey ( ArraySegment< byte >  data)

Imports a public key into the keyring.

Parameters
dataThe public key in binary or ASCII Armored format.
Exceptions
InvalidDataExceptiondata does not contain a valid public key.
See also
ExportKey

Implemented in ZeroInstall.Store.Trust.BouncyCastle, and ZeroInstall.Store.Trust.GnuPG.

◆ ListSecretKeys()

IEnumerable< OpenPgpSecretKey > ZeroInstall.Store.Trust.IOpenPgp.ListSecretKeys ( )

Returns a list of secret keys in the keyring.

See also
Sign, ExportKey

Implemented in ZeroInstall.Store.Trust.BouncyCastle, and ZeroInstall.Store.Trust.GnuPG.

◆ Sign()

byte[] ZeroInstall.Store.Trust.IOpenPgp.Sign ( ArraySegment< byte >  data,
OpenPgpSecretKey  secretKey,
string?  passphrase = null 
)

Creates a detached OpenPGP signature using a specific secret key.

Parameters
dataThe data to sign.
secretKeyThe secret key to use for signing.
passphraseThe passphrase to use to unlock the secret key.
Returns
The signature in binary format.
Exceptions
KeyNotFoundExceptionThe specified secretKey could not be found in the keyring.
WrongPassphraseExceptionpassphrase was incorrect.
See also
Verify

Implemented in ZeroInstall.Store.Trust.BouncyCastle, and ZeroInstall.Store.Trust.GnuPG.

◆ Verify()

IEnumerable< OpenPgpSignature > ZeroInstall.Store.Trust.IOpenPgp.Verify ( ArraySegment< byte >  data,
byte[]  signature 
)

Verifies a detached OpenPGP signature.

Parameters
dataThe data the signature is for.
signatureThe signature in binary format.
Returns
A list of signatures found, both valid and invalid. MissingKeySignature results indicate you need to use ImportKey.
Exceptions
InvalidDataExceptionsignature does not contain valid signature data.
See also
Sign

Implemented in ZeroInstall.Store.Trust.BouncyCastle, and ZeroInstall.Store.Trust.GnuPG.


The documentation for this interface was generated from the following file: