Documentation
¶
Overview ¶
Package testhelper implements utility routines required for writing unit tests. The testhelper should only be used in unit tests.
Index ¶
- type ECCertTuple
- type RSACertTuple
- func GetRSACertTuple(size int) RSACertTuple
- func GetRSACertTupleWithPK(privKey *rsa.PrivateKey, cn string, issuer *RSACertTuple) RSACertTuple
- func GetRSALeafCertificate() RSACertTuple
- func GetRSALeafCertificateWithoutEKU() RSACertTuple
- func GetRSARootCertificate() RSACertTuple
- func GetRSASelfSignedCertTupleWithPK(privKey *rsa.PrivateKey, cn string) RSACertTuple
- func GetRSASelfSignedSigningCertTuple(cn string) RSACertTuple
- func GetRSASelfSignedSigningCertificate() RSACertTuple
- func GetUnsupportedRSACert() RSACertTuple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ECCertTuple ¶
type ECCertTuple struct {
Cert *x509.Certificate
PrivateKey *ecdsa.PrivateKey
}
func GetECCertTuple ¶
func GetECCertTuple(curve elliptic.Curve) ECCertTuple
func GetECDSACertTupleWithPK ¶
func GetECDSACertTupleWithPK(privKey *ecdsa.PrivateKey, cn string, issuer *ECCertTuple) ECCertTuple
func GetECLeafCertificate ¶
func GetECLeafCertificate() ECCertTuple
GetECLeafCertificate returns leaf certificate signed using EC algorithm
func GetECRootCertificate ¶
func GetECRootCertificate() ECCertTuple
GetECRootCertificate returns root certificate signed using EC algorithm
func GetUnsupportedECCert ¶
func GetUnsupportedECCert() ECCertTuple
GetUnsupportedECCert returns certificate signed using EC algorithm with P-224 curve which is not supported by notary.
type RSACertTuple ¶
type RSACertTuple struct {
Cert *x509.Certificate
PrivateKey *rsa.PrivateKey
}
func GetRSACertTuple ¶
func GetRSACertTuple(size int) RSACertTuple
func GetRSACertTupleWithPK ¶
func GetRSACertTupleWithPK(privKey *rsa.PrivateKey, cn string, issuer *RSACertTuple) RSACertTuple
func GetRSALeafCertificate ¶
func GetRSALeafCertificate() RSACertTuple
GetRSALeafCertificate returns leaf certificate signed using RSA algorithm
func GetRSALeafCertificateWithoutEKU ¶
func GetRSALeafCertificateWithoutEKU() RSACertTuple
GetRSALeafCertificateWithoutEKU returns leaf certificate without EKU signed using RSA algorithm
func GetRSARootCertificate ¶
func GetRSARootCertificate() RSACertTuple
GetRSARootCertificate returns root certificate signed using RSA algorithm
func GetRSASelfSignedCertTupleWithPK ¶
func GetRSASelfSignedCertTupleWithPK(privKey *rsa.PrivateKey, cn string) RSACertTuple
func GetRSASelfSignedSigningCertTuple ¶
func GetRSASelfSignedSigningCertTuple(cn string) RSACertTuple
func GetRSASelfSignedSigningCertificate ¶
func GetRSASelfSignedSigningCertificate() RSACertTuple
GetRSASelfSignedSigningCertificate returns a self-signed certificate created which can be used for signing
func GetUnsupportedRSACert ¶
func GetUnsupportedRSACert() RSACertTuple
GetUnsupportedRSACert returns certificate signed using RSA algorithm with key size of 1024 bits which is not supported by notary.