@SuppressWarnings("unchecked") public static Vector<PGPPublicKey> getEncryptKeys(PGPPublicKeyRing keyRing) { Vector<PGPPublicKey> encryptKeys = new Vector<PGPPublicKey>(); for (PGPPublicKey key : new IterableIterator<PGPPublicKey>(keyRing.getPublicKeys())) { if (isEncryptionKey(key)) { encryptKeys.add(key); } } return encryptKeys; }
@SuppressWarnings("unchecked") public static PGPPublicKey getMasterKey(PGPPublicKeyRing keyRing) { if (keyRing == null) { return null; } for (PGPPublicKey key : new IterableIterator<PGPPublicKey>(keyRing.getPublicKeys())) { if (key.isMasterKey()) { return key; } } return null; }