List of usage examples for org.bouncycastle.openpgp PGPSecretKey getS2K
public S2K getS2K()
From source file:org.sufficientlysecure.keychain.pgp.PgpKeyOperation.java
License:Open Source License
static PGPSignatureGenerator getSignatureGenerator(PGPSecretKey secretKey, CryptoInputParcel cryptoInput) { S2K s2k = secretKey.getS2K(); boolean isDivertToCard = s2k != null && s2k.getType() == S2K.GNU_DUMMY_S2K && s2k.getProtectionMode() == S2K.GNU_PROTECTION_MODE_DIVERT_TO_CARD; return getSignatureGenerator(secretKey.getPublicKey(), cryptoInput, isDivertToCard); }
From source file:org.sufficientlysecure.keychain.pgp.PgpKeyOperation.java
License:Open Source License
private static boolean isDummy(PGPSecretKey secretKey) { S2K s2k = secretKey.getS2K(); return s2k != null && s2k.getType() == S2K.GNU_DUMMY_S2K && s2k.getProtectionMode() != S2K.GNU_PROTECTION_MODE_DIVERT_TO_CARD; }
From source file:org.sufficientlysecure.keychain.pgp.PgpKeyOperation.java
License:Open Source License
private static boolean isDivertToCard(PGPSecretKey secretKey) { S2K s2k = secretKey.getS2K(); return s2k != null && s2k.getType() == S2K.GNU_DUMMY_S2K && s2k.getProtectionMode() == S2K.GNU_PROTECTION_MODE_DIVERT_TO_CARD; }