Package com.google.crypto.tink.signature
Class SignaturePemKeysetReader
- java.lang.Object
-
- com.google.crypto.tink.signature.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();
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSignaturePemKeysetReader.BuilderBuilder for SignaturePemKeysetReader
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SignaturePemKeysetReader.BuildernewBuilder()Returns aSignaturePemKeysetReader.BuilderforSignaturePemKeysetReader.com.google.crypto.tink.proto.Keysetread()Tries to read and return a cleartextKeyset.com.google.crypto.tink.proto.EncryptedKeysetreadEncrypted()Tries to read and return anEncryptedKeyset.
-
-
-
Method Detail
-
newBuilder
public static SignaturePemKeysetReader.Builder newBuilder()
Returns aSignaturePemKeysetReader.BuilderforSignaturePemKeysetReader.
-
read
public com.google.crypto.tink.proto.Keyset read() throws java.io.IOExceptionDescription copied from interface:KeysetReaderTries to read and return a cleartextKeyset.- Specified by:
readin interfaceKeysetReader- Returns:
- the Keyset
- Throws:
java.io.IOException
-
readEncrypted
public com.google.crypto.tink.proto.EncryptedKeyset readEncrypted() throws java.io.IOExceptionDescription copied from interface:KeysetReaderTries to read and return anEncryptedKeyset.- Specified by:
readEncryptedin interfaceKeysetReader- Returns:
- the EncryptedKeyset
- Throws:
java.io.IOException
-
-