rsa_signingservice

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AcceptHeader   = "Accept"
	AlgorithHeader = "X-SignatatureAlgorithm"

	// MediaTypePEM defines the media type for PEM formatted data.
	MediaTypePEM = "application/x-pem-file"
)
View Source
const (
	Algorithm = rsa.Algorithm
	Name      = "rsa-signingsservice"
)

Algorithm defines the type for the RSA PKCS #1 v1.5 signature algorithm.

View Source
const SignaturePEMBlockAlgorithmHeader = "Algorithm"

SignaturePEMBlockAlgorithmHeader defines the header in a signature pem block where the signature algorithm is defined.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct{}

Handler is a signatures.Signer compatible struct to sign with RSASSA-PKCS1-V1_5. using a signature service.

func (Handler) Algorithm

func (h Handler) Algorithm() string

func (Handler) Sign

func (h Handler) Sign(digest string, hash crypto.Hash, issuer string, key interface{}) (signature *signing.Signature, err error)

type Key

type Key struct {
	URL      string `json:"url"`
	Username string `json:"username"`
	Password string `json:"password"`
}

func PrivateKey

func PrivateKey(k interface{}) (*Key, error)

type SigningServerSigner

type SigningServerSigner struct {
	Url      string `json:"url"`
	Username string `json:"username"`
	Password string `json:"password"`
}

func NewSigningClient

func NewSigningClient(url string, username, password string) (*SigningServerSigner, error)

func (*SigningServerSigner) Sign

func (signer *SigningServerSigner) Sign(algo string, digest string, issuer string, key interface{}) (*signing.Signature, error)

Jump to

Keyboard shortcuts

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