List of usage examples for org.bouncycastle.openpgp PGPSecretKeyRing removeSecretKey
public static PGPSecretKeyRing removeSecretKey(PGPSecretKeyRing secRing, PGPSecretKey secKey)
From source file:org.sufficientlysecure.keychain.pgp.UncachedKeyRing.java
License:Open Source License
/** This method removes a subkey in a keyring. * * This method essentially wraps PGP*KeyRing.remove*Key, where the keyring may be of either * the secret or public subclass./*from w ww .j a va 2 s . c om*/ * * @return the resulting PGPKeyRing of the same type as the input */ private static PGPKeyRing removeSubKey(PGPKeyRing ring, PGPPublicKey key) { if (ring instanceof PGPPublicKeyRing) { return PGPPublicKeyRing.removePublicKey((PGPPublicKeyRing) ring, key); } else { PGPSecretKey sKey = ((PGPSecretKeyRing) ring).getSecretKey(key.getKeyID()); return PGPSecretKeyRing.removeSecretKey((PGPSecretKeyRing) ring, sKey); } }