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
keyAlgorithmPublicKeyAlgorithmTaghashAlgorithmHashAlgorithmTag
Methods
Generate()
Return a signature object containing the current signature state.
public PgpSignature Generate()
Returns
GenerateCertification(PgpPublicKey)
Generate a certification, such as a revocation, for the passed in key.
public PgpSignature GenerateCertification(PgpPublicKey pubKey)
Parameters
pubKeyPgpPublicKeyThe 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
masterKeyPgpPublicKeyThe key we are certifying against.
pubKeyPgpPublicKeyThe 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
userAttributesPgpUserAttributeSubpacketVectorThe ID we are certifying against the public key.
pubKeyPgpPublicKeyThe 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
idstringThe ID we are certifying against the public key.
pubKeyPgpPublicKeyThe 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
isNestedbool
Returns
InitSign(int, PgpPrivateKey)
Initialise the generator for signing.
public void InitSign(int sigType, PgpPrivateKey privKey)
Parameters
sigTypeintprivKeyPgpPrivateKey
InitSign(int, PgpPrivateKey, SecureRandom)
Initialise the generator for signing.
public void InitSign(int sigType, PgpPrivateKey privKey, SecureRandom random)
Parameters
sigTypeintprivKeyPgpPrivateKeyrandomSecureRandom
SetHashedSubpackets(PgpSignatureSubpacketVector)
public void SetHashedSubpackets(PgpSignatureSubpacketVector hashedPackets)
Parameters
hashedPacketsPgpSignatureSubpacketVector
SetUnhashedSubpackets(PgpSignatureSubpacketVector)
public void SetUnhashedSubpackets(PgpSignatureSubpacketVector unhashedPackets)
Parameters
unhashedPacketsPgpSignatureSubpacketVector
Update(byte)
public void Update(byte b)
Parameters
bbyte
Update(params byte[])
public void Update(params byte[] b)
Parameters
bbyte[]
Update(byte[], int, int)
public void Update(byte[] b, int off, int len)
Parameters
Update(ReadOnlySpan<byte>)
public void Update(ReadOnlySpan<byte> input)
Parameters
inputReadOnlySpan<byte>