| Modifier and Type | Field and Description |
|---|---|
| pack-priv PGPPublicKey | |
| pack-priv SecretKeyPacket |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv | PGPSecretKey(PGPPrivateKey privKey, PGPPublicKey pubKey, PGPDigestCalculator checksumCalculator, PBESecretKeyEncryptor keyEncryptor)
|
| public | PGPSecretKey(PGPPrivateKey
the private key component. privKey, PGPPublicKey the public key component. pubKey, PGPDigestCalculator a calculator for the private key checksum checksumCalculator, boolean true if the key is a master key, false otherwise. isMasterKey, PBESecretKeyEncryptor an encryptor for the key if required (null otherwise). keyEncryptor)Construct a PGPSecretKey using the passed in private key and public key. |
| public | PGPSecretKey(int
the type of certification to be added. certificationLevel, PGPKeyPair the public/private keys to use. keyPair, String the id to bind to the key. id, PGPSignatureSubpacketVector the hashed packets to be added to the certification. hashedPcks, PGPSignatureSubpacketVector the unhashed packets to be added to the certification. unhashedPcks, PGPContentSignerBuilder the builder for generating the certification. certificationSignerBuilder, PBESecretKeyEncryptor an encryptor for the key if required (null otherwise). keyEncryptor)Construct a PGPSecretKey using the passed in private/public key pair and binding it to the passed in id using a generated certification of certificationLevel.The secret key checksum is calculated using the original non-digest based checksum. |
| public | PGPSecretKey(PGPKeyPair
the master public/private keys for the new subkey. masterKeyPair, PGPKeyPair the public/private keys to use. keyPair, PGPDigestCalculator a calculator for the private key checksum checksumCalculator, PGPContentSignerBuilder the builder for generating the certification. certificationSignerBuilder, PBESecretKeyEncryptor an encryptor for the key if required (null otherwise). keyEncryptor)Construct a PGPSecretKey sub-key using the passed in private/public key pair and binding it to the master key pair. |
| public | PGPSecretKey(PGPKeyPair
the master public/private keys for the new subkey. masterKeyPair, PGPKeyPair the public/private keys to use. keyPair, PGPDigestCalculator calculator for PGP key checksums. checksumCalculator, PGPSignatureSubpacketVector the hashed packets to be added to the certification. hashedPcks, PGPSignatureSubpacketVector the unhashed packets to be added to the certification. unhashedPcks, PGPContentSignerBuilder the builder for generating the certification. certificationSignerBuilder, PBESecretKeyEncryptor an encryptor for the key if required (null otherwise). keyEncryptor)Construct a PGPSecretKey sub-key using the passed in private/public key pair and binding it to the master key pair. |
| public | PGPSecretKey(int
the type of certification to be added. certificationLevel, PGPKeyPair the public/private keys to use. keyPair, String the id to bind to the key. id, PGPDigestCalculator a calculator for the private key checksum. checksumCalculator, PGPSignatureSubpacketVector the hashed packets to be added to the certification. hashedPcks, PGPSignatureSubpacketVector the unhashed packets to be added to the certification. unhashedPcks, PGPContentSignerBuilder the builder for generating the certification. certificationSignerBuilder, PBESecretKeyEncryptor an encryptor for the key if required (null otherwise). keyEncryptor)Construct a PGPSecretKey using the passed in private/public key pair and binding it to the passed in id using a generated certification of certificationLevel. |
| Modifier and Type | Method and Description |
|---|---|
| private static PGPPublicKey | |
| private static SecretKeyPacket | buildSecretKeyPacket(boolean isMasterKey, PGPPrivateKey privKey, PGPPublicKey pubKey, PBESecretKeyEncryptor keyEncryptor, PGPDigestCalculator checksumCalculator)
|
| private static PGPPublicKey | certifiedPublicKey(int certificationLevel, PGPKeyPair keyPair, String id, PGPSignatureSubpacketVector hashedPcks, PGPSignatureSubpacketVector unhashedPcks, PGPContentSignerBuilder certificationSignerBuilder)
|
| private static byte[] | |
| pack-priv static boolean | |
| public static PGPSecretKey | copyWithNewPassword(PGPSecretKey
the PGPSecretKey to be copied. key, PBESecretKeyDecryptor the current decryptor based on the current password for key. oldKeyDecryptor, PBESecretKeyEncryptor a new encryptor based on a new password for encrypting the secret key material. newKeyEncryptor)Return a copy of the passed in secret key, encrypted using a new password and the passed in algorithm. |
| public static PGPSecretKey | copyWithNewPassword(PGPSecretKey
the PGPSecretKey to be copied. key, PBESecretKeyDecryptor the current decryptor based on the current password for key. oldKeyDecryptor, PBESecretKeyEncryptor a new encryptor based on a new password for encrypting the secret key material. newKeyEncryptor, PGPDigestCalculator digest based checksum calculator for private key data. checksumCalculator)Return a copy of the passed in secret key, encrypted using a new password and the passed in algorithm. |
| public void | |
| private byte[] | |
| public PGPKeyPair | Returns: PGPPrivateKey the unencrypted private key.factory to use to generate a decryptor for the passed in secretKey. decryptorFactory)Extract a PGPPrivate key from the SecretKey's encrypted contents. |
| public PGPPrivateKey | Returns: PGPPrivateKey the unencrypted private key.factory to use to generate a decryptor for the passed in secretKey. decryptorFactory)Extract a PGPPrivate key from the SecretKey's encrypted contents. |
| public byte[] | |
| public int | Returns: the algorithm used to encrypt the secret key.return the algorithm the key is encrypted with. |
| public long | Returns: the keyID associated with this key.Return the keyID of the public key associated with this key. |
| public PGPPublicKey | |
| public S2K | |
| public int | |
| public Iterator | Returns: an iterator of PGPUserAttributeSubpacketVector.Return any user attribute vectors associated with the key. |
| public Iterator | |
| public boolean | |
| public boolean | Returns: boolean whether or not the private key is emptyDetect if the Secret Key's Private Key is empty or not |
| public boolean | Returns: true if this key algorithm is suitable for use with signing.Return true if this key has an algorithm type that makes it suitable to use for signing. |
| public static PGPSecretKey | Returns: a secret key object.
Deprecated
use org.bouncycastle.gpg.SExprParser - it will also allow you to verify the protection checksum if it is available.
Parse a secret key from one of the GPG S expression keys associating it with the passed in public key.
|
| public static PGPSecretKey | Returns: a secret key object.
Deprecated
use org.bouncycastle.gpg.SExprParser - it will also allow you to verify the protection checksum if it is available.
Parse a secret key from one of the GPG S expression keys.
|
| public static PGPSecretKey | Returns: a new secret key.secret key to change secretKey, PGPPublicKey new public key. publicKey)Replace the passed the public key on the passed in secret key. |
| pub | back to summary |
|---|---|
| pack-priv PGPPublicKey pub | |
| secret | back to summary |
|---|---|
| pack-priv SecretKeyPacket secret | |
| PGPSecretKey | back to summary |
|---|---|
| public PGPSecretKey(SecretKeyPacket secret, PGPPublicKey pub) | |
| PGPSecretKey | back to summary |
|---|---|
| pack-priv PGPSecretKey(PGPPrivateKey privKey, PGPPublicKey pubKey, PGPDigestCalculator checksumCalculator, PBESecretKeyEncryptor keyEncryptor) throws PGPException | |
| PGPSecretKey | back to summary |
|---|---|
| public PGPSecretKey(PGPPrivateKey privKey, PGPPublicKey pubKey, PGPDigestCalculator checksumCalculator, boolean isMasterKey, PBESecretKeyEncryptor keyEncryptor) throws PGPException Construct a PGPSecretKey using the passed in private key and public key. This constructor will not add any certifications but assumes that pubKey already has what is required.
| |
| PGPSecretKey | back to summary |
|---|---|
| public PGPSecretKey(int certificationLevel, PGPKeyPair keyPair, String id, PGPSignatureSubpacketVector hashedPcks, PGPSignatureSubpacketVector unhashedPcks, PGPContentSignerBuilder certificationSignerBuilder, PBESecretKeyEncryptor keyEncryptor) throws PGPException Construct a PGPSecretKey using the passed in private/public key pair and binding it to the passed in id using a generated certification of certificationLevel.The secret key checksum is calculated using the original non-digest based checksum.
| |
| PGPSecretKey | back to summary |
|---|---|
| public PGPSecretKey(PGPKeyPair masterKeyPair, PGPKeyPair keyPair, PGPDigestCalculator checksumCalculator, PGPContentSignerBuilder certificationSignerBuilder, PBESecretKeyEncryptor keyEncryptor) throws PGPException Construct a PGPSecretKey sub-key using the passed in private/public key pair and binding it to the master key pair. The secret key checksum is calculated using the passed in checksum calculator.
| |
| PGPSecretKey | back to summary |
|---|---|
| public PGPSecretKey(PGPKeyPair masterKeyPair, PGPKeyPair keyPair, PGPDigestCalculator checksumCalculator, PGPSignatureSubpacketVector hashedPcks, PGPSignatureSubpacketVector unhashedPcks, PGPContentSignerBuilder certificationSignerBuilder, PBESecretKeyEncryptor keyEncryptor) throws PGPException Construct a PGPSecretKey sub-key using the passed in private/public key pair and binding it to the master key pair. The secret key checksum is calculated using the passed in checksum calculator.
| |
| PGPSecretKey | back to summary |
|---|---|
| public PGPSecretKey(int certificationLevel, PGPKeyPair keyPair, String id, PGPDigestCalculator checksumCalculator, PGPSignatureSubpacketVector hashedPcks, PGPSignatureSubpacketVector unhashedPcks, PGPContentSignerBuilder certificationSignerBuilder, PBESecretKeyEncryptor keyEncryptor) throws PGPException Construct a PGPSecretKey using the passed in private/public key pair and binding it to the passed in id using a generated certification of certificationLevel.
| |
| buildPublicKey | back to summary |
|---|---|
| private static PGPPublicKey buildPublicKey(boolean isMasterKey, PGPPublicKey pubKey) | |
| buildSecretKeyPacket | back to summary |
|---|---|
| private static SecretKeyPacket buildSecretKeyPacket(boolean isMasterKey, PGPPrivateKey privKey, PGPPublicKey pubKey, PBESecretKeyEncryptor keyEncryptor, PGPDigestCalculator checksumCalculator) throws PGPException | |
| certifiedPublicKey | back to summary |
|---|---|
| private static PGPPublicKey certifiedPublicKey(int certificationLevel, PGPKeyPair keyPair, String id, PGPSignatureSubpacketVector hashedPcks, PGPSignatureSubpacketVector unhashedPcks, PGPContentSignerBuilder certificationSignerBuilder) throws PGPException | |
| checksum | back to summary |
|---|---|
| private static byte[] checksum(PGPDigestCalculator digCalc, byte[] bytes, int length) throws PGPException | |
| constantTimeAreEqual | back to summary |
|---|---|
| pack-priv static boolean constantTimeAreEqual(int len, byte[] a, int aOff, byte[] b, int bOff) | |
| copyWithNewPassword | back to summary |
|---|---|
| public static PGPSecretKey copyWithNewPassword(PGPSecretKey key, PBESecretKeyDecryptor oldKeyDecryptor, PBESecretKeyEncryptor newKeyEncryptor) throws PGPException Return a copy of the passed in secret key, encrypted using a new password and the passed in algorithm.
| |
| copyWithNewPassword | back to summary |
|---|---|
| public static PGPSecretKey copyWithNewPassword(PGPSecretKey key, PBESecretKeyDecryptor oldKeyDecryptor, PBESecretKeyEncryptor newKeyEncryptor, PGPDigestCalculator checksumCalculator) throws PGPException Return a copy of the passed in secret key, encrypted using a new password and the passed in algorithm.
| |
| encode | back to summary |
|---|---|
| public void encode(OutputStream outStream) throws IOException | |
| extractKeyData | back to summary |
|---|---|
| private byte[] extractKeyData(PBESecretKeyDecryptor decryptorFactory) throws PGPException | |
| extractKeyPair | back to summary |
|---|---|
| public PGPKeyPair extractKeyPair(PBESecretKeyDecryptor decryptorFactory) throws PGPException Extract a PGPPrivate key from the SecretKey's encrypted contents.
| |
| extractPrivateKey | back to summary |
|---|---|
| public PGPPrivateKey extractPrivateKey(PBESecretKeyDecryptor decryptorFactory) throws PGPException Extract a PGPPrivate key from the SecretKey's encrypted contents.
| |
| getEncoded | back to summary |
|---|---|
| public byte[] getEncoded() throws IOException | |
| getKeyEncryptionAlgorithm | back to summary |
|---|---|
| public int getKeyEncryptionAlgorithm() return the algorithm the key is encrypted with.
| |
| getKeyID | back to summary |
|---|---|
| public long getKeyID() Return the keyID of the public key associated with this key.
| |
| getPublicKey | back to summary |
|---|---|
| public PGPPublicKey getPublicKey() Return the public key associated with this key.
| |
| getS2K | back to summary |
|---|---|
| public S2K getS2K() Return the S2K used to process this key
| |
| getS2KUsage | back to summary |
|---|---|
| public int getS2KUsage() Return the S2K usage associated with this key.
| |
| getUserAttributes | back to summary |
|---|---|
| public Iterator Return any user attribute vectors associated with the key.
| |
| getUserIDs | back to summary |
|---|---|
| public Iterator Return any userIDs associated with the key. | |
| isMasterKey | back to summary |
|---|---|
| public boolean isMasterKey() Return true if this is a master key.
| |
| isPrivateKeyEmpty | back to summary |
|---|---|
| public boolean isPrivateKeyEmpty() Detect if the Secret Key's Private Key is empty or not
| |
| isSigningKey | back to summary |
|---|---|
| public boolean isSigningKey() Return true if this key has an algorithm type that makes it suitable to use for signing. Note with version 4 keys KeyFlags subpackets should also be considered when present for determining the preferred use of the key.
| |
| parseSecretKeyFromSExpr | back to summary |
|---|---|
| public static PGPSecretKey parseSecretKeyFromSExpr(InputStream inputStream, PBEProtectionRemoverFactory keyProtectionRemoverFactory, PGPPublicKey pubKey) throws IOException, PGPException
Deprecated use org.bouncycastle.gpg.SExprParser - it will also allow you to verify the protection checksum if it is available. Parse a secret key from one of the GPG S expression keys associating it with the passed in public key.
| |
| parseSecretKeyFromSExpr | back to summary |
|---|---|
| public static PGPSecretKey parseSecretKeyFromSExpr(InputStream inputStream, PBEProtectionRemoverFactory keyProtectionRemoverFactory, KeyFingerPrintCalculator fingerPrintCalculator) throws IOException, PGPException
Deprecated use org.bouncycastle.gpg.SExprParser - it will also allow you to verify the protection checksum if it is available. Parse a secret key from one of the GPG S expression keys.
| |
| replacePublicKey | back to summary |
|---|---|
| public static PGPSecretKey replacePublicKey(PGPSecretKey secretKey, PGPPublicKey publicKey) Replace the passed the public key on the passed in secret key.
| |