Top Description Inners Fields Constructors Methods
org.bouncycastle.gpg

public Class SExprParser

extends Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, .OutputStream, java.math.BigInteger, java.util.Date, .HashMap, .Map, org.bouncycastle.asn1.ASN1ObjectIdentifier, org.bouncycastle.asn1.edec.EdECObjectIdentifiers, org.bouncycastle.asn1.teletrust.TeleTrusTNamedCurves, org.bouncycastle.asn1.x9.ECNamedCurveTable, .X9ECParametersHolder, org.bouncycastle.bcpg.BCPGKey, .DSAPublicBCPGKey, .DSASecretBCPGKey, .ECDSAPublicBCPGKey, .ECPublicBCPGKey, .ECSecretBCPGKey, .EdDSAPublicBCPGKey, .EdSecretBCPGKey, .ElGamalPublicBCPGKey, .ElGamalSecretBCPGKey, .HashAlgorithmTags, .PublicKeyAlgorithmTags, .PublicKeyPacket, .RSAPublicBCPGKey, .RSASecretBCPGKey, .S2K, .SecretKeyPacket, .SymmetricKeyAlgorithmTags, org.bouncycastle.crypto.ec.CustomNamedCurves, org.bouncycastle.math.ec.ECPoint, org.bouncycastle.openpgp.PGPException, .PGPPublicKey, .PGPSecretKey, .PGPUtil, org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator, .PBEProtectionRemoverFactory, .PBESecretKeyDecryptor, .PGPDigestCalculator, .PGPDigestCalculatorProvider, .PGPSecretKeyDecryptorWithAAD, org.bouncycastle.util.Arrays, .BigIntegers, .Strings

A parser for secret keys stored in SExpr

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface
private static interface
public static interface
private static interface

Field Summary

Modifier and TypeField and Description
private final PGPDigestCalculatorProvider
private static final String[]
private static final Map<Integer, String[]>
private static final Map<Integer, String[]>
private static final String[]
private static final Map<Integer, String[]>
private static final String[]
private static final Map<Integer, String[]>

Constructor Summary

AccessConstructor and Description
public
SExprParser(PGPDigestCalculatorProvider
a provider for digest calculations. Used to confirm key protection hashes.
digestProvider
)

Base constructor.

Method Summary

Modifier and TypeMethod and Description
private static void
private static BCPGKey
public static PublicKeyAlgorithmTags[]
getPGPSecretKey(PBEProtectionRemoverFactory keyProtectionRemoverFactory, KeyFingerPrintCalculator fingerPrintCalculator, PGPPublicKey pubKey, int maxDepth, int type, final SExpression expression, String keyType, PGPDigestCalculatorProvider digestProvider)

private static int
public static int
private static PGPPublicKey
getPublicKey(KeyFingerPrintCalculator fingerPrintCalculator, PGPPublicKey pubKey, SExpression expression, int publicKeyAlgorithmTags, String[] bigIntegerLabels, SExprParser.getPublicKeyOperation operation)

private static SecretKeyPacket
getSecKeyPacket(PGPPublicKey pubKey, PBEProtectionRemoverFactory keyProtectionRemoverFactory, int maxDepth, int type, SExpression expression, PGPDigestCalculatorProvider digestProvider, Map<Integer, String[]> labels, SExprParser.GetSecKeyDataOperation operation)

private PGPSecretKey
parse(InputStream inputStream, PBEProtectionRemoverFactory keyProtectionRemoverFactory, KeyFingerPrintCalculator fingerPrintCalculator, PGPPublicKey pubKey)

public PGPSecretKey

Returns:

a secret key object.
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.

public PGPSecretKey

Returns:

a secret key object.
parseSecretKey
(InputStream inputStream, PBEProtectionRemoverFactory keyProtectionRemoverFactory, KeyFingerPrintCalculator fingerPrintCalculator)

Parse a secret key from one of the GPG S expression keys.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

digestProviderback to summary
private final PGPDigestCalculatorProvider digestProvider
dsaBigIntegersback to summary
private static final String[] dsaBigIntegers
dsaLabelsback to summary
private static final Map<Integer, String[]> dsaLabels
eccLabelsback to summary
private static final Map<Integer, String[]> eccLabels
elgBigIntegersback to summary
private static final String[] elgBigIntegers
elgLabelsback to summary
private static final Map<Integer, String[]> elgLabels
rsaBigIntegersback to summary
private static final String[] rsaBigIntegers
rsaLabelsback to summary
private static final Map<Integer, String[]> rsaLabels

Constructor Detail

SExprParserback to summary
public SExprParser(PGPDigestCalculatorProvider digestProvider)

Base constructor.

Parameters
digestProvider:PGPDigestCalculatorProvider

a provider for digest calculations. Used to confirm key protection hashes.

Method Detail

assertEccPublicKeyMathback to summary
private static void assertEccPublicKeyMath(BCPGKey key1, PGPPublicKey key2) throws PGPException
getECCBasePublicKeyback to summary
private static BCPGKey getECCBasePublicKey(SExpression expression)
getPGPSecretKeyback to summary
public static PublicKeyAlgorithmTags[] getPGPSecretKey(PBEProtectionRemoverFactory keyProtectionRemoverFactory, KeyFingerPrintCalculator fingerPrintCalculator, PGPPublicKey pubKey, int maxDepth, int type, final SExpression expression, String keyType, PGPDigestCalculatorProvider digestProvider) throws PGPException, IOException
getProtectionModeback to summary
private static int getProtectionMode(String str)
getProtectionTypeback to summary
public static int getProtectionType(String str)
getPublicKeyback to summary
private static PGPPublicKey getPublicKey(KeyFingerPrintCalculator fingerPrintCalculator, PGPPublicKey pubKey, SExpression expression, int publicKeyAlgorithmTags, String[] bigIntegerLabels, SExprParser.getPublicKeyOperation operation) throws PGPException
getSecKeyPacketback to summary
private static SecretKeyPacket getSecKeyPacket(PGPPublicKey pubKey, PBEProtectionRemoverFactory keyProtectionRemoverFactory, int maxDepth, int type, SExpression expression, PGPDigestCalculatorProvider digestProvider, Map<Integer, String[]> labels, SExprParser.GetSecKeyDataOperation operation) throws PGPException, IOException
parseback to summary
private PGPSecretKey parse(InputStream inputStream, PBEProtectionRemoverFactory keyProtectionRemoverFactory, KeyFingerPrintCalculator fingerPrintCalculator, PGPPublicKey pubKey) throws IOException, PGPException
parseSecretKeyback to summary
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:PGPSecretKey

a secret key object.

parseSecretKeyback to summary
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:PGPSecretKey

a secret key object.

org.bouncycastle.gpg back to summary

private Interface SExprParser.getPublicKeyOperation


Method Summary

Modifier and TypeMethod and Description
public void
public BCPGKey

Method Detail

assertPublicKeyMatchback to summary
public void assertPublicKeyMatch(BCPGKey key1, BCPGKey key2) throws PGPException
getBasePublicKeyback to summary
public BCPGKey getBasePublicKey(BigInteger[] bigIntegers)
org.bouncycastle.gpg back to summary

private Interface SExprParser.GetSecKeyDataOperation


Method Summary

Modifier and TypeMethod and Description
public byte[]

Method Detail

getSecKeyDataback to summary
public byte[] getSecKeyData(SExpression keyIn)
org.bouncycastle.gpg back to summary

public Interface SExprParser.ProtectionFormatTypeTags


Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int
public static final int

Field Detail

OPENPGP_PRIVATE_KEYback to summary
public static final int OPENPGP_PRIVATE_KEY
PRIVATE_KEYback to summary
public static final int PRIVATE_KEY
PROTECTED_PRIVATE_KEYback to summary
public static final int PROTECTED_PRIVATE_KEY
PROTECTED_SHARED_SECRETback to summary
public static final int PROTECTED_SHARED_SECRET
SHADOWED_PRIVATE_KEYback to summary
public static final int SHADOWED_PRIVATE_KEY
org.bouncycastle.gpg back to summary

private Interface SExprParser.ProtectionModeTags


Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int

Field Detail

OPENPGP_NATIVEback to summary
public static final int OPENPGP_NATIVE
OPENPGP_S2K3_OCB_AESback to summary
public static final int OPENPGP_S2K3_OCB_AES
OPENPGP_S2K3_SHA1_AES_CBCback to summary
public static final int OPENPGP_S2K3_SHA1_AES_CBC