Package org.bouncycastle.gpg
Class SExprParser
java.lang.Object
org.bouncycastle.gpg.SExprParser
A parser for secret keys stored in SExpr
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PublicKeyAlgorithmTags[]
getPGPSecretKey
(PBEProtectionRemoverFactory keyProtectionRemoverFactory, KeyFingerPrintCalculator fingerPrintCalculator, PGPPublicKey pubKey, int maxDepth, int type, SExpression expression, String keyType, PGPDigestCalculatorProvider digestProvider) static int
getProtectionType
(String str) parseSecretKey
(InputStream inputStream, PBEProtectionRemoverFactory keyProtectionRemoverFactory, KeyFingerPrintCalculator fingerPrintCalculator) Parse a secret key from one of the GPG S expression keys.parseSecretKey
(InputStream inputStream, PBEProtectionRemoverFactory keyProtectionRemoverFactory, PGPPublicKey pubKey) Parse a secret key from one of the GPG S expression keys associating it with the passed in public key.
-
Constructor Details
-
SExprParser
Base constructor.- Parameters:
digestProvider
- a provider for digest calculations. Used to confirm key protection hashes.
-
-
Method Details
-
parseSecretKey
public PGPSecretKey parseSecretKey(InputStream inputStream, PBEProtectionRemoverFactory keyProtectionRemoverFactory, PGPPublicKey pubKey) throws IOException, PGPException Parse a secret key from one of the GPG S expression keys associating it with the passed in public key.- Returns:
- a secret key object.
- Throws:
IOException
PGPException
-
parseSecretKey
public PGPSecretKey parseSecretKey(InputStream inputStream, PBEProtectionRemoverFactory keyProtectionRemoverFactory, KeyFingerPrintCalculator fingerPrintCalculator) throws IOException, PGPException Parse a secret key from one of the GPG S expression keys.- Returns:
- a secret key object.
- Throws:
IOException
PGPException
-
getPGPSecretKey
public static PublicKeyAlgorithmTags[] getPGPSecretKey(PBEProtectionRemoverFactory keyProtectionRemoverFactory, KeyFingerPrintCalculator fingerPrintCalculator, PGPPublicKey pubKey, int maxDepth, int type, SExpression expression, String keyType, PGPDigestCalculatorProvider digestProvider) throws PGPException, IOException - Throws:
PGPException
IOException
-
getProtectionType
-