private static KeyPair entry2Pair()

in sdk1/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/providers/KeyStoreMaterialsProvider.java [125:143]


  private static KeyPair entry2Pair(Entry entry) {
    PublicKey pub = null;
    PrivateKey priv = null;

    if (entry instanceof PrivateKeyEntry) {
      PrivateKeyEntry pk = (PrivateKeyEntry) entry;
      if (pk.getCertificate() != null) {
        pub = pk.getCertificate().getPublicKey();
      }
      priv = pk.getPrivateKey();
    } else if (entry instanceof TrustedCertificateEntry) {
      TrustedCertificateEntry tc = (TrustedCertificateEntry) entry;
      pub = tc.getTrustedCertificate().getPublicKey();
    } else {
      throw new IllegalArgumentException(
          "Only entry types PrivateKeyEntry and TrustedCertificateEntry are supported.");
    }
    return new KeyPair(pub, priv);
  }