예제 #1
0
  @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;
  }
예제 #2
0
  @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;
  }