Documentation ¶
Index ¶
- Constants
- Variables
- func CreateKeyPair() (priv signutils.GenericPrivateKey, pub signutils.GenericPublicKey, err error)
- func GetPrivateKey(key interface{}) (*rsa.PrivateKey, error)
- func GetPublicKey(key interface{}) (*rsa.PublicKey, *pkix.Name, error)
- func KeyData(key interface{}) ([]byte, error)
- func NewHandler() signing.SignatureHandler
- func NewHandlerFor(m *Method) signing.SignatureHandler
- 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 signutils.GenericPrivateKey, pub signutils.GenericPublicKey, err error)
- func (h *Handler) Sign(cctx credentials.Context, digest string, sctx signing.SigningContext) (signature *signing.Signature, err error)
- func (h *Handler) Verify(digest string, signature *signing.Signature, sctx signing.SigningContext) (err error)
- type Method
- 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 = signutils.MediaTypePEM
MediaTypePEM is used if the signature contains the public key certificate chain.
Variables ¶
View Source
var PKCS1v15 = &Method{ Algorithm: Algorithm, MediaType: MediaType, Sign: rsa.SignPKCS1v15, Verify: rsa.VerifyPKCS1v15, }
Functions ¶
func CreateKeyPair ¶ added in v0.5.0
func CreateKeyPair() (priv signutils.GenericPrivateKey, pub signutils.GenericPublicKey, err error)
func GetPrivateKey ¶
func GetPrivateKey(key interface{}) (*rsa.PrivateKey, error)
func NewHandler ¶ added in v0.7.0
func NewHandler() signing.SignatureHandler
func NewHandlerFor ¶ added in v0.7.0
func NewHandlerFor(m *Method) signing.SignatureHandler
func ParsePrivateKey ¶
func ParsePrivateKey(data []byte) (*rsa.PrivateKey, error)
func ParsePublicKey ¶
func WriteKeyData ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
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 ¶
func (_ Handler) CreateKeyPair() (priv signutils.GenericPrivateKey, pub signutils.GenericPublicKey, err error)
type PrivateKey ¶
type PrivateKey = rsa.PrivateKey
func CreateRootCertificate ¶ added in v0.6.0
func CreateRootCertificate(sub *pkix.Name, validity time.Duration) (*x509.Certificate, *PrivateKey, error)
func CreateSigningCertificate ¶ added in v0.6.0
func CreateSigningCertificate(sub *pkix.Name, intermediate signutils.GenericCertificateChain, roots signutils.GenericCertificatePool, capriv signutils.GenericPrivateKey, validity time.Duration, isCA ...bool) (*x509.Certificate, []byte, *PrivateKey, error)
Click to show internal directories.
Click to hide internal directories.