Documentation ¶
Index ¶
- Constants
- func GetPrivateKey(key interface{}) (*rsa.PrivateKey, error)
- func GetPublicKey(key interface{}) (*rsa.PublicKey, []string, error)
- func GetSignaturePEMBlocks(pemData []byte) ([]*pem.Block, error)
- func KeyData(key interface{}) ([]byte, error)
- func ParseKey(data []byte) (interface{}, error)
- func ParsePrivateKey(data []byte) (*rsa.PrivateKey, error)
- func ParsePublicKey(data []byte) (interface{}, error)
- func PemBlockForKey(priv interface{}, gen ...bool) (*pem.Block, error)
- func WriteKeyData(key interface{}, w io.Writer) error
- type Handler
- func (h Handler) Algorithm() string
- func (_ Handler) CreateKeyPair() (priv interface{}, pub interface{}, err error)
- func (h Handler) Sign(cctx credentials.Context, digest string, hash crypto.Hash, issuer string, ...) (signature *signing.Signature, err error)
- func (h Handler) Verify(digest string, hash crypto.Hash, signature *signing.Signature, key interface{}) (err error)
- type PrivateKey
- type PublicKey
Constants ¶
View Source
const Algorithm = "RSASSA-PKCS1-V1_5"
Algorithm defines the type for the RSA PKCS #1 v1.5 signature algorithm.
View Source
const MediaType = "application/vnd.ocm.signature.rsa"
MediaType defines the media type for a plain RSA signature.
View Source
const MediaTypePEM = "application/x-pem-file"
MediaTypePEM defines the media type for PEM formatted data.
View Source
const SignaturePEMBlockAlgorithmHeader = "Signature Algorithm"
SignaturePEMBlockAlgorithmHeader defines the header in a signature pem block where the signature algorithm is defined.
View Source
const SignaturePEMBlockType = "SIGNATURE"
SignaturePEMBlockType defines the type of a signature pem block.
Variables ¶
This section is empty.
Functions ¶
func GetPrivateKey ¶
func GetPrivateKey(key interface{}) (*rsa.PrivateKey, error)
func GetSignaturePEMBlocks ¶
GetSignaturePEMBlocks returns all signature pem blocks from a list of pem blocks.
func ParsePrivateKey ¶
func ParsePrivateKey(data []byte) (*rsa.PrivateKey, error)
func ParsePublicKey ¶
func WriteKeyData ¶
Types ¶
type Handler ¶
type Handler struct{}
Handler is a signatures.Signer compatible struct to sign with RSASSA-PKCS1-V1_5. and a signatures.Verifier compatible struct to verify RSASSA-PKCS1-V1_5 signatures.
func (Handler) CreateKeyPair ¶
type PrivateKey ¶
type PrivateKey = rsa.PrivateKey
Click to show internal directories.
Click to hide internal directories.