Cryptix OpenPGP

cryptix.openpgp
Class PGPAbstractV3SignatureParameterBuilder

java.lang.Object
  extended bycryptix.openpgp.PGPAbstractV3SignatureParameterBuilder
Direct Known Subclasses:
PGPLegacyCertificateParameterBuilder, PGPLegacySelfCertificateParameterBuilder

public abstract class PGPAbstractV3SignatureParameterBuilder
extends java.lang.Object

Abstract class for v3 signature parameters.

Version:
$Revision: 1.2 $
Author:
Edwin Woudt

Constructor Summary
protected PGPAbstractV3SignatureParameterBuilder(java.security.Key issuerkey, byte sigtype)
          Construct a new PGPAbstractV3SignatureParameterBuilder using the given issuer key and signature type byte.
protected PGPAbstractV3SignatureParameterBuilder(KeyID issuerkeyid, byte sigtype)
          Construct a new PGPAbstractV3SignatureParameterBuilder using the given issuer key id and signature type byte.
 
Method Summary
 java.security.spec.AlgorithmParameterSpec build()
          Build an immutable parameter specification This method can be called more than once, which is useful in case you want to create multiple signatures with almost the same parameters.
 void setCreationDate(java.util.Date creation)
          Set the signature creation date packet With this method one can set the signature creation date and time to any random value.
 void setIssuerKeyID(KeyID issuerkeyid)
          Set the issuer key id
 void setSignatureType(byte sigtype)
          Sets the signature type byte
 void updateCreationDate()
          Updates the signature creation date packet to the current date and time This method is simply a wrapper around setCreationDate, calling it with the current date and time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PGPAbstractV3SignatureParameterBuilder

protected PGPAbstractV3SignatureParameterBuilder(KeyID issuerkeyid,
                                                 byte sigtype)
Construct a new PGPAbstractV3SignatureParameterBuilder using the given issuer key id and signature type byte.

Parameters:
issuerkeyid - the key id of the key issuing the signature
sigtype - the signature type byte

PGPAbstractV3SignatureParameterBuilder

protected PGPAbstractV3SignatureParameterBuilder(java.security.Key issuerkey,
                                                 byte sigtype)
                                          throws java.security.InvalidKeyException
Construct a new PGPAbstractV3SignatureParameterBuilder using the given issuer key and signature type byte.

Note: this is just a convenience method that will extract the key id from the given key. If you already have the key id, calling the other constructor with that key id is faster.

Parameters:
issuerkey - the key issuing the signature
sigtype - the signature type byte
Throws:
java.security.InvalidKeyException - if getting the key id of the issuer key fails because of an incompatible or invalid key.
Method Detail

build

public java.security.spec.AlgorithmParameterSpec build()
Build an immutable parameter specification

This method can be called more than once, which is useful in case you want to create multiple signatures with almost the same parameters. Note that in this case all parameters will stay the same, including the creation date and time, which may not be desirable. Use the updateCreationDate() method to prevent this from happening.


updateCreationDate

public void updateCreationDate()
Updates the signature creation date packet to the current date and time

This method is simply a wrapper around setCreationDate, calling it with the current date and time.


setCreationDate

public void setCreationDate(java.util.Date creation)
Set the signature creation date packet

With this method one can set the signature creation date and time to any random value. While this has useful applications, it should be used carefully because setting it to something else than the current time may break some things.

Parameters:
creation - the new date and time

setIssuerKeyID

public void setIssuerKeyID(KeyID issuerkeyid)
Set the issuer key id

Parameters:
issuerkeyid - the key id of the key issuing the signature

setSignatureType

public void setSignatureType(byte sigtype)
Sets the signature type byte

Parameters:
sigtype - the new signature type byte

Cryptix OpenPGP

Copyright (C) 1999-2003 The Cryptix Foundation Ltd.