Table of Contents

Class PgpSignatureGenerator

Namespace
Org.BouncyCastle.Bcpg.OpenPgp
Assembly
BouncyCastle.Cryptography.dll
public class PgpSignatureGenerator
Inheritance
PgpSignatureGenerator
Inherited Members

Remarks

Generator for PGP signatures.

Constructors

PgpSignatureGenerator(PublicKeyAlgorithmTag, HashAlgorithmTag)

Create a generator for the passed in keyAlgorithm and hashAlgorithm codes.

public PgpSignatureGenerator(PublicKeyAlgorithmTag keyAlgorithm, HashAlgorithmTag hashAlgorithm)

Parameters

keyAlgorithm PublicKeyAlgorithmTag
hashAlgorithm HashAlgorithmTag

Methods

Generate()

Return a signature object containing the current signature state.

public PgpSignature Generate()

Returns

PgpSignature

GenerateCertification(PgpPublicKey)

Generate a certification, such as a revocation, for the passed in key.

public PgpSignature GenerateCertification(PgpPublicKey pubKey)

Parameters

pubKey PgpPublicKey

The key we are certifying.

Returns

PgpSignature

The certification.

GenerateCertification(PgpPublicKey, PgpPublicKey)

Generate a certification for the passed in key against the passed in master key.

public PgpSignature GenerateCertification(PgpPublicKey masterKey, PgpPublicKey pubKey)

Parameters

masterKey PgpPublicKey

The key we are certifying against.

pubKey PgpPublicKey

The key we are certifying.

Returns

PgpSignature

The certification.

GenerateCertification(PgpUserAttributeSubpacketVector, PgpPublicKey)

Generate a certification for the passed in userAttributes.

public PgpSignature GenerateCertification(PgpUserAttributeSubpacketVector userAttributes, PgpPublicKey pubKey)

Parameters

userAttributes PgpUserAttributeSubpacketVector

The ID we are certifying against the public key.

pubKey PgpPublicKey

The key we are certifying against the ID.

Returns

PgpSignature

The certification.

GenerateCertification(string, PgpPublicKey)

Generate a certification for the passed in ID and key.

public PgpSignature GenerateCertification(string id, PgpPublicKey pubKey)

Parameters

id string

The ID we are certifying against the public key.

pubKey PgpPublicKey

The key we are certifying against the ID.

Returns

PgpSignature

The certification.

GenerateOnePassVersion(bool)

Return the one pass header associated with the current signature.

public PgpOnePassSignature GenerateOnePassVersion(bool isNested)

Parameters

isNested bool

Returns

PgpOnePassSignature

InitSign(int, PgpPrivateKey)

Initialise the generator for signing.

public void InitSign(int sigType, PgpPrivateKey privKey)

Parameters

sigType int
privKey PgpPrivateKey

InitSign(int, PgpPrivateKey, SecureRandom)

Initialise the generator for signing.

public void InitSign(int sigType, PgpPrivateKey privKey, SecureRandom random)

Parameters

sigType int
privKey PgpPrivateKey
random SecureRandom

SetHashedSubpackets(PgpSignatureSubpacketVector)

public void SetHashedSubpackets(PgpSignatureSubpacketVector hashedPackets)

Parameters

hashedPackets PgpSignatureSubpacketVector

SetUnhashedSubpackets(PgpSignatureSubpacketVector)

public void SetUnhashedSubpackets(PgpSignatureSubpacketVector unhashedPackets)

Parameters

unhashedPackets PgpSignatureSubpacketVector

Update(byte)

public void Update(byte b)

Parameters

b byte

Update(params byte[])

public void Update(params byte[] b)

Parameters

b byte[]

Update(byte[], int, int)

public void Update(byte[] b, int off, int len)

Parameters

b byte[]
off int
len int

Update(ReadOnlySpan<byte>)

public void Update(ReadOnlySpan<byte> input)

Parameters

input ReadOnlySpan<byte>