|
Cryptix OpenPGP | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcryptix.openpgp.PGPAbstractSignatureParameterBuilder
Abstract class for signature parameters.
Constructor Summary | |
protected |
PGPAbstractSignatureParameterBuilder(java.security.Key issuerkey,
byte sigtype)
Construct a new PGPAbstractSignatureParameterBuilder using the given issuer key and signature type byte. |
protected |
PGPAbstractSignatureParameterBuilder(KeyID issuerkeyid,
byte sigtype)
Construct a new PGPAbstractSignatureParameterBuilder using the given issuer key id and signature type byte. |
Method Summary | |
void |
addPacket(cryptix.openpgp.signature.PGPSignatureSubPacket ssp)
Add a packet to the hashed area This method simply adds the packet to the hashed area, without checking if a packet with the same id already exists. |
void |
addUnhashedPacket(cryptix.openpgp.signature.PGPSignatureSubPacket ssp)
Add a packet to the unhashed area This method simply adds the packet to the unhashed area, without checking if a packet with the same id already exists. |
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. |
cryptix.openpgp.signature.PGPSignatureSubPacket |
removePacket(byte packetid)
Remove the packet in the hashed area with the given packetid Note: if more than one packet with the given packetid exist in the hashed area, then only one (the first one) will be removed. |
cryptix.openpgp.signature.PGPSignatureSubPacket |
removeUnhashedPacket(byte packetid)
Remove the packet in the unhashed area with the given packetid Note: if more than one packet with the given packetid exist in the unhashed area, then only one (the first one) will be removed. |
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 |
cryptix.openpgp.signature.PGPSignatureSubPacket |
setPacket(cryptix.openpgp.signature.PGPSignatureSubPacket ssp)
Add or replace a packet into the hashed area If a packet with the same packetid already exists in the hashed area it is replaced by the given packet. |
void |
setSignatureType(byte sigtype)
Sets the signature type byte |
cryptix.openpgp.signature.PGPSignatureSubPacket |
setUnhashedPacket(cryptix.openpgp.signature.PGPSignatureSubPacket ssp)
Add or replace a packet into the unhashed area If a packet with the same packetid already exists in the unhashed area it is replaced by the given packet. |
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 |
protected PGPAbstractSignatureParameterBuilder(KeyID issuerkeyid, byte sigtype)
issuerkeyid
- the key id of the key issuing the signaturesigtype
- the signature type byteprotected PGPAbstractSignatureParameterBuilder(java.security.Key issuerkey, byte sigtype) throws java.security.InvalidKeyException
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.
issuerkey
- the key issuing the signaturesigtype
- the signature type byte
java.security.InvalidKeyException
- if getting the key id of the issuer key fails
because of an incompatible or invalid key.Method Detail |
public java.security.spec.AlgorithmParameterSpec build()
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.
public void updateCreationDate()
This method is simply a wrapper around setCreationDate, calling it with the current date and time.
public void setCreationDate(java.util.Date creation)
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.
creation
- the new date and timepublic void setIssuerKeyID(KeyID issuerkeyid)
issuerkeyid
- the key id of the key issuing the signaturepublic void setSignatureType(byte sigtype)
sigtype
- the new signature type bytepublic void addPacket(cryptix.openpgp.signature.PGPSignatureSubPacket ssp)
This method simply adds the packet to the hashed area, without checking if a packet with the same id already exists. In many cases, using the setPacket(...) method is therefore a better idea.
ssp
- the signature subpacket that should be added to the hashed
area.public cryptix.openpgp.signature.PGPSignatureSubPacket setPacket(cryptix.openpgp.signature.PGPSignatureSubPacket ssp)
If a packet with the same packetid already exists in the hashed area it is replaced by the given packet. Otherwise the given packet is simply added.
ssp
- the signature subpacket that should be added to the hashed
area.
public cryptix.openpgp.signature.PGPSignatureSubPacket removePacket(byte packetid)
Note: if more than one packet with the given packetid exist in the hashed area, then only one (the first one) will be removed.
packetid
- the ID of the packet to remove
public void addUnhashedPacket(cryptix.openpgp.signature.PGPSignatureSubPacket ssp)
This method simply adds the packet to the unhashed area, without checking if a packet with the same id already exists. In many cases, using the setUnhashedPacket(...) method is therefore a better idea.
ssp
- the signature subpacket that should be added to the hashed
area.public cryptix.openpgp.signature.PGPSignatureSubPacket setUnhashedPacket(cryptix.openpgp.signature.PGPSignatureSubPacket ssp)
If a packet with the same packetid already exists in the unhashed area it is replaced by the given packet. Otherwise the given packet is simply added.
ssp
- the signature subpacket that should be added to the unhashed
area.
public cryptix.openpgp.signature.PGPSignatureSubPacket removeUnhashedPacket(byte packetid)
Note: if more than one packet with the given packetid exist in the unhashed area, then only one (the first one) will be removed.
packetid
- the ID of the packet to remove
|
Cryptix OpenPGP | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |