SignPKCS1v15 (rsa/pkcs1v15.go)

go · src/crypto/internal/fips140/rsa/pkcs1v15.go · go · BSD-3-Clause
security, tag:knn-classified

Provides PKCS#1 v1.5 RSA signing and verification with hash support.

// Source: https://github.com/golang/go | License: BSD-3-Clause | Copyright 2009 The Go Authors
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package rsa

// This file implements signing and verification using PKCS #1 v1.5 signatures.

import (
	"bytes"
	"crypto/internal/fips140"
	"errors"
)

// These are ASN1 DER structures:
//
//	DigestInfo ::= SEQUENCE {
//	  digestAlgorithm AlgorithmIdentifier,
//	  digest OCTET STRING
//	}
//
// For performance, we don't use the generic ASN1 encoder. Rather, we
// precompute a prefix of the digest value that makes a valid ASN1 DER string
// with the correct contents.
//
// Fo

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key