Package org.pgpainless.signature.builder

# Class UniversalSignatureBuilder

java.lang.Object
org.pgpainless.signature.builder.AbstractSignatureBuilder<UniversalSignatureBuilder>
org.pgpainless.signature.builder.UniversalSignatureBuilder

public class UniversalSignatureBuilder extends AbstractSignatureBuilder<UniversalSignatureBuilder>
Signature builder without restrictions on subpacket contents.

## Field Summary

### Fields inherited from class org.pgpainless.signature.builder.AbstractSignatureBuilder

`hashAlgorithm, hashedSubpackets, privateSigningKey, publicSigningKey, signatureType, unhashedSubpackets`

## Constructor Summary

Constructors
Constructor
Description
`UniversalSignatureBuilder(org.bouncycastle.openpgp.PGPSecretKey certificationKey, SecretKeyRingProtector protector, org.bouncycastle.openpgp.PGPSignature archetypeSignature)`
`UniversalSignatureBuilder(SignatureType signatureType, org.bouncycastle.openpgp.PGPSecretKey signingKey, SecretKeyRingProtector protector)`

## Method Summary

Modifier and Type
Method
Description
`void`
`applyCallback(SignatureSubpackets.Callback callback)`
`SignatureSubpackets`
`getHashedSubpackets()`
`org.bouncycastle.openpgp.PGPSignatureGenerator`
`getSignatureGenerator()`
`SignatureSubpackets`
`getUnhashedSubpackets()`
`protected boolean`
`isValidSignatureType(SignatureType type)`
Return true if the given `SignatureType` is a valid choice for the concrete implementation of `AbstractSignatureBuilder`.

### Methods inherited from class org.pgpainless.signature.builder.AbstractSignatureBuilder

`buildAndInitSignatureGenerator, negotiateHashAlgorithm, overrideHashAlgorithm, setSignatureType`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### UniversalSignatureBuilder

public UniversalSignatureBuilder(SignatureType signatureType, org.bouncycastle.openpgp.PGPSecretKey signingKey, SecretKeyRingProtector protector) throws org.bouncycastle.openpgp.PGPException

Throws:
  `org.bouncycastle.openpgp.PGPException`

### UniversalSignatureBuilder

public UniversalSignatureBuilder(org.bouncycastle.openpgp.PGPSecretKey certificationKey, SecretKeyRingProtector protector, org.bouncycastle.openpgp.PGPSignature archetypeSignature) throws org.bouncycastle.openpgp.PGPException

Throws:
  `org.bouncycastle.openpgp.PGPException`

## Method Details

### isValidSignatureType

protected boolean isValidSignatureType(SignatureType type)
Description copied from class: `AbstractSignatureBuilder`
Return true if the given `SignatureType` is a valid choice for the concrete implementation of `AbstractSignatureBuilder`.

Specified by:
  `isValidSignatureType` in class `AbstractSignatureBuilder<UniversalSignatureBuilder>`
Parameters:
  `type` - type
Returns:
  return true if valid, false otherwise

### getHashedSubpackets

public SignatureSubpackets getHashedSubpackets()

### getUnhashedSubpackets

public SignatureSubpackets getUnhashedSubpackets()

### applyCallback

public void applyCallback(@Nullable SignatureSubpackets.Callback callback)

### getSignatureGenerator

public org.bouncycastle.openpgp.PGPSignatureGenerator getSignatureGenerator() throws org.bouncycastle.openpgp.PGPException

Throws:
  `org.bouncycastle.openpgp.PGPException`