org.bouncycastle.openpgp
public class PGPSecretKey extends Object
Constructor Summary | |
---|---|
PGPSecretKey(int certificationLevel, PGPKeyPair keyPair, String id, int encAlgorithm, char[] passPhrase, PGPSignatureSubpacketVector hashedPcks, PGPSignatureSubpacketVector unhashedPcks, SecureRandom rand, String provider) | |
PGPSecretKey(int certificationLevel, PGPKeyPair keyPair, String id, int encAlgorithm, char[] passPhrase, boolean useSHA1, PGPSignatureSubpacketVector hashedPcks, PGPSignatureSubpacketVector unhashedPcks, SecureRandom rand, String provider) | |
PGPSecretKey(int certificationLevel, int algorithm, PublicKey pubKey, PrivateKey privKey, Date time, String id, int encAlgorithm, char[] passPhrase, PGPSignatureSubpacketVector hashedPcks, PGPSignatureSubpacketVector unhashedPcks, SecureRandom rand, String provider) | |
PGPSecretKey(int certificationLevel, int algorithm, PublicKey pubKey, PrivateKey privKey, Date time, String id, int encAlgorithm, char[] passPhrase, boolean useSHA1, PGPSignatureSubpacketVector hashedPcks, PGPSignatureSubpacketVector unhashedPcks, SecureRandom rand, String provider) |
Method Summary | |
---|---|
static PGPSecretKey | copyWithNewPassword(PGPSecretKey key, char[] oldPassPhrase, char[] newPassPhrase, int newEncAlgorithm, SecureRandom rand, String provider)
Return a copy of the passed in secret key, encrypted using a new
password and the passed in algorithm.
|
void | encode(OutputStream outStream) |
PGPPrivateKey | extractPrivateKey(char[] passPhrase, String provider)
Extract a PGPPrivate key from the SecretKey's encrypted contents.
|
byte[] | getEncoded() |
int | getKeyEncryptionAlgorithm()
return the algorithm the key is encrypted with.
|
long | getKeyID()
Return the keyID of the public key associated with this key.
|
PGPPublicKey | getPublicKey()
Return the public key associated with this key.
|
Iterator | getUserAttributes()
Return any user attribute vectors associated with the key.
|
Iterator | getUserIDs()
Return any userIDs associated with the key.
|
boolean | isMasterKey()
Return true if this is a master key. |
boolean | isSigningKey()
return true if this key is marked as suitable for signature generation. |
Parameters: key the PGPSecretKey to be copied. oldPassPhrase the current password for key. newPassPhrase the new password for the key. newEncAlgorithm the algorithm to be used for the encryption. rand source of randomness. provider the provider to use
Parameters: passPhrase provider
Returns: PGPPrivateKey
Throws: PGPException NoSuchProviderException
Returns: the algorithm used to encrypt the secret key.
Returns: the keyID associated with this key.
Returns: the public key for this key.
Returns: an iterator of Strings.
Returns: an iterator of Strings.
Returns: true if a master key.