| java.lang.Object org.bouncycastle.openpgp.PGPPublicKey
Constructor Summary | |
public | PGPPublicKey(int algorithm, PublicKey pubKey, Date time, String provider) Create a PGPPublicKey from the passed in JCA one. | | PGPPublicKey(PublicKeyPacket publicPk, TrustPacket trustPk, List sigs) | | PGPPublicKey(PGPPublicKey key, TrustPacket trust, List subSigs) | | PGPPublicKey(PGPPublicKey pubKey) Copy constructor. | | PGPPublicKey(PublicKeyPacket publicPk, TrustPacket trustPk, List keySigs, List ids, List idTrusts, List idSigs) | | PGPPublicKey(PublicKeyPacket publicPk, List ids, List idSigs) |
PGPPublicKey | public PGPPublicKey(int algorithm, PublicKey pubKey, Date time, String provider) throws PGPException, NoSuchProviderException(Code) | | Create a PGPPublicKey from the passed in JCA one.
Note: the time passed in affects the value of the key's keyID, so you probably only want
to do this once for a JCA key, or make sure you keep track of the time you used.
Parameters: algorithm - asymmetric algorithm type representing the public key. Parameters: pubKey - actual public key to associate. Parameters: time - date of creation. Parameters: provider - provider to use for underlying digest calculations. throws: PGPException - on key creation problem. throws: NoSuchProviderException - if the specified provider is required and cannot be found. |
PGPPublicKey | PGPPublicKey(PGPPublicKey pubKey)(Code) | | Copy constructor.
Parameters: pubKey - the public key to copy. |
addCertification | public static PGPPublicKey addCertification(PGPPublicKey key, String id, PGPSignature certification)(Code) | | Add a certification to the given public key.
Parameters: key - the key the certification is to be added to. Parameters: id - the id the certification is associated with. Parameters: certification - the new certification. the re-certified key. |
addCertification | public static PGPPublicKey addCertification(PGPPublicKey key, PGPSignature certification)(Code) | | Add a revocation or some other key certification to a key.
Parameters: key - the key the revocation is to be added to. Parameters: certification - the key signature to be added. the new changed public key object. |
getAlgorithm | public int getAlgorithm()(Code) | | Return the algorithm code associated with the public key.
int |
getBitStrength | public int getBitStrength()(Code) | | Return the strength of the key in bits.
bit strenght of key. |
getCreationTime | public Date getCreationTime()(Code) | | creation time of key. |
getFingerprint | public byte[] getFingerprint()(Code) | | Return the fingerprint of the key.
key fingerprint. |
getKeyID | public long getKeyID()(Code) | | Return the keyID associated with the public key.
long |
getSignatures | public Iterator getSignatures()(Code) | | Return all signatures/certifications associated with this key.
an iterator (possibly empty) with all signatures/certifications. |
getSignaturesForID | public Iterator getSignaturesForID(String id)(Code) | | Return any signatures associated with the passed in id.
Parameters: id - the id to be matched. an iterator of PGPSignature objects. |
getSignaturesForUserAttribute | public Iterator getSignaturesForUserAttribute(PGPUserAttributeSubpacketVector userAttributes)(Code) | | Return an iterator of signatures associated with the passed in user attributes.
Parameters: userAttributes - the vector of user attributes to be matched. an iterator of PGPSignature objects. |
getSignaturesOfType | public Iterator getSignaturesOfType(int signatureType)(Code) | | Return signatures of the passed in type that are on this key.
Parameters: signatureType - the type of the signature to be returned. an iterator (possibly empty) of signatures of the given type. |
getTrustData | public byte[] getTrustData()(Code) | | Return the trust data associated with the public key, if present.
a byte array with trust data, null otherwise. |
getUserAttributes | public Iterator getUserAttributes()(Code) | | Return any user attribute vectors associated with the key.
an iterator of PGPUserAttributeSubpacketVector objects. |
getUserIDs | public Iterator getUserIDs()(Code) | | Return any userIDs associated with the key.
an iterator of Strings. |
getValidDays | public int getValidDays()(Code) | | number of valid days from creation time - zero means noexpiry. |
getValidSeconds | public long getValidSeconds()(Code) | | number of valid seconds from creation time - zero means noexpiry. |
getVersion | public int getVersion()(Code) | | the version of this key. |
isEncryptionKey | public boolean isEncryptionKey()(Code) | | Return true if this key is marked as suitable for using for encryption.
true if this key is marked as suitable for using for encryption. |
isMasterKey | public boolean isMasterKey()(Code) | | Return true if this is a master key.
true if a master key. |
isRevoked | public boolean isRevoked()(Code) | | Check whether this (sub)key has a revocation signature on it.
boolean indicating whether this (sub)key has been revoked. |
removeCertification | public static PGPPublicKey removeCertification(PGPPublicKey key, String id)(Code) | | Remove any certifications associated with a given id on a key.
Parameters: key - the key the certifications are to be removed from. Parameters: id - the id that is to be removed. the re-certified key, null if the id was not found on the key. |
removeCertification | public static PGPPublicKey removeCertification(PGPPublicKey key, String id, PGPSignature certification)(Code) | | Remove any certifications associated with a given id on a key.
Parameters: key - the key the certifications are to be removed from. Parameters: id - the id that the certfication is to be removed from. Parameters: certification - the certfication to be removed. the re-certified key, null if the certification was not found. |
|
|