rsapad

package
v0.0.0-...-15d4781 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2019 License: ISC Imports: 5 Imported by: 0

Documentation

Overview

Package rsapad implements RSA padding, extracted from the standard library.

The Go standard library implements RSA padding as part of RSA signing/encryption but does not expose these primitives separately. Smart cards implement the signing/encryption but not padding portions of RSA, so we must perform padding manually

package rsapad provides RSA padding functions extracted from the Go standard library

These functions are necessary as smartcards often only implement parts of the usual smartcard signing operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DigestInfoWrap

func DigestInfoWrap(hash crypto.Hash, hashed []byte) ([]byte, error)

DigestInfoWrap wraps `hashed` in the PKCS1v1.5 DigestInfo struct for `hash`

func PadPSS

func PadPSS(rand io.Reader, pub *rsa.PublicKey, hash crypto.Hash, hashed []byte, opts *rsa.PSSOptions) ([]byte, error)

PadPSS calculates PSS padding

func PadSignPKCS1v15

func PadSignPKCS1v15(pub *rsa.PublicKey, hash crypto.Hash, hashed []byte) ([]byte, error)

PadSignPKCS1v15 calculates the padding for signing using RSA PKCS#1 v1.5

This function is deterministic. Thus, if the set of possible messages is small, an attacker may be able to build a map from messages to signatures and identify the signed messages. As ever, signatures provide authenticity, not confidentiality.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL