private static boolean isSecret(KeyData keyData) {
    return keyData.getKeyMaterialType() == KeyData.KeyMaterialType.UNKNOWN_KEYMATERIAL
        || keyData.getKeyMaterialType() == KeyData.KeyMaterialType.SYMMETRIC
        || keyData.getKeyMaterialType() == KeyData.KeyMaterialType.ASYMMETRIC_PRIVATE;
  }
Constructs a ProtoKey with {@code hasSecret()} returning true if the input {@code KeyData} has
key material of type UNKNOWN_KEYMATERIAL, SYMMETRIC, or ASYMMETRIC_PRIVATE.
java_src/src/main/java/com/google/crypto/tink/tinkkey/internal/ProtoKey.java