Class SignaturePemKeysetReader

  • All Implemented Interfaces:
    KeysetReader

    public final class SignaturePemKeysetReader
    extends java.lang.Object
    implements KeysetReader
    SignaturePemKeysetReader reads digital signature keys in PEM format (RFC 7468).

    Only supports public keys.

    Warning: Private, invalid, incompatible or unparsable keys are silently ignored, without throwing an exception. This only throws an exception if no valid keys are found at all.

    Usage

    
     import com.google.crypto.tink.PemKeyType;
    
     String pem = ...;
     PemKeyType type = ...;
     String pem2 = ...;
     PemKeyType type2 = ...;
     KeysetHandle handle = SignaturePemKeysetReader.newBuilder()
         .addPem(pem, type)
         .addPem(pem2, type2)
         .buildPublicKeysetHandle();