Class SigUtil
- java.lang.Object
-
- com.google.crypto.tink.signature.internal.SigUtil
-
public final class SigUtil extends java.lang.ObjectUtility functions to convert to and from signature-related proto.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EllipticCurves.CurveTypetoCurveType(com.google.crypto.tink.proto.EllipticCurveType type)Converts protobuf enumEllipticCurveTypeto raw Java enum {code CurveType}.static EllipticCurves.EcdsaEncodingtoEcdsaEncoding(com.google.crypto.tink.proto.EcdsaSignatureEncoding encoding)Converts protobuf enumEcdsaSignatureEncodingto raw Java enum {code EllipticCurves.EcdsaEncoding}.static Enums.HashTypetoHashType(com.google.crypto.tink.proto.HashType hash)Converts protobuf enumHashTypeto raw Java enumEnums.HashType.static com.google.protobuf.ByteStringtoUnsignedIntByteString(java.math.BigInteger i)Returns the unsigned byte representation of the input BigInteger.
-
-
-
Method Detail
-
toHashType
public static Enums.HashType toHashType(com.google.crypto.tink.proto.HashType hash) throws java.security.GeneralSecurityException
Converts protobuf enumHashTypeto raw Java enumEnums.HashType.- Throws:
java.security.GeneralSecurityException- if the HashType is not SHA256, SHA384, or SHA512.
-
toCurveType
public static EllipticCurves.CurveType toCurveType(com.google.crypto.tink.proto.EllipticCurveType type) throws java.security.GeneralSecurityException
Converts protobuf enumEllipticCurveTypeto raw Java enum {code CurveType}.- Throws:
java.security.GeneralSecurityException
-
toEcdsaEncoding
public static EllipticCurves.EcdsaEncoding toEcdsaEncoding(com.google.crypto.tink.proto.EcdsaSignatureEncoding encoding) throws java.security.GeneralSecurityException
Converts protobuf enumEcdsaSignatureEncodingto raw Java enum {code EllipticCurves.EcdsaEncoding}.- Throws:
java.security.GeneralSecurityException
-
toUnsignedIntByteString
public static com.google.protobuf.ByteString toUnsignedIntByteString(java.math.BigInteger i)
Returns the unsigned byte representation of the input BigInteger. BigInteger's toByteArray returns a two's complement representation of non-negative integers, which might include an extra zero byte at position 0 (in big endian).
-
-