|
Bouncy Castle Cryptography 1.26 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.bouncycastle.openpgp.PGPPublicKey
general class to handle a PGP public key object.
Fields inherited from interface org.bouncycastle.bcpg.PublicKeyAlgorithmTags |
DIFFIE_HELLMAN,
DSA,
EC,
ECDSA,
ELGAMAL_ENCRYPT,
ELGAMAL_GENERAL,
RSA_ENCRYPT,
RSA_GENERAL,
RSA_SIGN |
Constructor Summary | |
PGPPublicKey(int algorithm,
java.security.PublicKey pubKey,
java.util.Date time,
java.lang.String provider)
Create a PGPPublicKey from the passed in JCA one. |
Method Summary | |
static PGPPublicKey |
addCertification(PGPPublicKey key,
PGPSignature certification)
Add a revocation or some other key certification to a key. |
static PGPPublicKey |
addCertification(PGPPublicKey key,
java.lang.String id,
PGPSignature certification)
Add a certification to the given public key. |
void |
encode(java.io.OutputStream outStream)
|
int |
getAlgorithm()
Return the algorithm code associated with the public key. |
int |
getBitStrength()
Return the strength of the key in bits. |
java.util.Date |
getCreationTime()
|
byte[] |
getEncoded()
|
byte[] |
getFingerprint()
Return the fingerprint of the key. |
java.security.PublicKey |
getKey(java.lang.String provider)
Return the public key contained in the object. |
long |
getKeyID()
Return the keyID associated with the public key. |
java.util.Iterator |
getSignatures()
Return all signatures/certifications associated with this key. |
java.util.Iterator |
getSignaturesForID(java.lang.String id)
Return any signatures associated with the passed in id. |
java.util.Iterator |
getSignaturesForUserAttribute(PGPUserAttributeSubpacketVector userAttributes)
Return an iterator of signatures associated with the passed in user attributes. |
java.util.Iterator |
getSignaturesOfType(int signatureType)
Return signatures of the passed in type that are on this key. |
java.util.Iterator |
getUserAttributes()
Return any user attribute vectors associated with the key. |
java.util.Iterator |
getUserIDs()
Return any userIDs associated with the key. |
int |
getValidDays()
|
int |
getVersion()
|
boolean |
isEncryptionKey()
return true if this key is marked as suitable for encryption. |
boolean |
isMasterKey()
Return true if this is a master key. |
static PGPPublicKey |
removeCertification(PGPPublicKey key,
java.lang.String id)
Remove any certifications associated with a given id on a key. |
static PGPPublicKey |
removeCertification(PGPPublicKey key,
java.lang.String id,
PGPSignature certification)
Remove any certifications associated with a given id on a key. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public PGPPublicKey(int algorithm, java.security.PublicKey pubKey, java.util.Date time, java.lang.String provider) throws PGPException, java.security.NoSuchProviderException
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.
algorithm
- pubKey
- time
- provider
- Method Detail |
public int getVersion()
public java.util.Date getCreationTime()
public int getValidDays()
public long getKeyID()
public byte[] getFingerprint()
public boolean isEncryptionKey()
public boolean isMasterKey()
public int getAlgorithm()
public int getBitStrength()
public java.security.PublicKey getKey(java.lang.String provider) throws PGPException, java.security.NoSuchProviderException
provider
- provider to construct the key for.public java.util.Iterator getUserIDs()
public java.util.Iterator getUserAttributes()
public java.util.Iterator getSignaturesForID(java.lang.String id)
id
- the id to be matched.public java.util.Iterator getSignaturesForUserAttribute(PGPUserAttributeSubpacketVector userAttributes)
userAttributes
- the vector of user attributes to be matched.public java.util.Iterator getSignaturesOfType(int signatureType)
signatureType
- the type of the signature to be returned.public java.util.Iterator getSignatures()
public byte[] getEncoded() throws java.io.IOException
public void encode(java.io.OutputStream outStream) throws java.io.IOException
public static PGPPublicKey addCertification(PGPPublicKey key, java.lang.String id, PGPSignature certification)
key
- the key the certification is to be added to.id
- the id the certification is associated with.certification
- the new certification.public static PGPPublicKey removeCertification(PGPPublicKey key, java.lang.String id)
key
- the key the certifications are to be removed from.id
- the id that is to be removed.public static PGPPublicKey removeCertification(PGPPublicKey key, java.lang.String id, PGPSignature certification)
key
- the key the certifications are to be removed from.id
- the id that the certfication is to be removed from.certification
- the certfication to be removed.public static PGPPublicKey addCertification(PGPPublicKey key, PGPSignature certification)
key
- the key the revocation is to be added to.certification
- the key signature to be added.
|
Bouncy Castle Cryptography 1.26 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |