package internal

import "github.com/google/tink/go/signature/internal"

Package internal implements digital signatures.

Index

Functions

func HashSafeForSignature

func HashSafeForSignature(hashAlg string) error

HashSafeForSignature checks whether a hash function is safe to use with digital signatures that require collision resistance.

func RSAValidModulusSizeInBits

func RSAValidModulusSizeInBits(m int) error

RSAValidModulusSizeInBits the size in bits for an RSA key.

func RSAValidPublicExponent

func RSAValidPublicExponent(e int) error

RSAValidPublicExponent validates a public RSA exponent.

Types

type RSA_SSA_PKCS1_Signer

type RSA_SSA_PKCS1_Signer struct {
	// contains filtered or unexported fields
}

RSA_SSA_PKCS1_Signer is an implementation of Signer for RSA-SSA-PKCS1.

func New_RSA_SSA_PKCS1_Signer

func New_RSA_SSA_PKCS1_Signer(hashAlg string, privKey *rsa.PrivateKey) (*RSA_SSA_PKCS1_Signer, error)

New_RSA_SSA_PKCS1_Signer creates a new intance of RSA_SSA_PKCS1_Signer.

func (*RSA_SSA_PKCS1_Signer) Sign

func (s *RSA_SSA_PKCS1_Signer) Sign(data []byte) ([]byte, error)

Sign computes a signature for the given data.

type RSA_SSA_PKCS1_Verifier

type RSA_SSA_PKCS1_Verifier struct {
	// contains filtered or unexported fields
}

RSA_SSA_PKCS1_Verifier is an implementation of Verifier for RSA-SSA-PKCS1.

func New_RSA_SSA_PKCS1_Verifier

func New_RSA_SSA_PKCS1_Verifier(hashAlg string, pubKey *rsa.PublicKey) (*RSA_SSA_PKCS1_Verifier, error)

New_RSA_SSA_PKCS1_Verifier creates a new intance of RSASSAPKCS1Verifier.

func (*RSA_SSA_PKCS1_Verifier) Verify

func (v *RSA_SSA_PKCS1_Verifier) Verify(signature, data []byte) error

Verify verifies whether the given signaure is valid for the given data. It returns an error if the signature is not valid; nil otherwise.

Source Files

internal.go rsa.go rsassapkcs1_signer.go rsassapkcs1_verifier.go

Version
v1.7.0 (latest)
Published
Aug 10, 2022
Platform
linux/amd64
Imports
7 packages
Last checked
3 months ago

Tools for package owners.