Documentation ¶
Index ¶
- Constants
- Variables
- func Base64Decode(in string) ([]byte, error)
- func Base64Encode(in []byte) string
- func GenerateECCSR(csr *config.CertAttributes, key *ecdsa.PrivateKey, sigalgo uint) ([]byte, error)
- func GenerateECKey(curve uint8) (*ecdsa.PrivateKey, error)
- func GenerateSelfSignedCert(csr *config.CertAttributes, key *ecdsa.PrivateKey, sigalgo uint, ...) ([]byte, error)
- func GenerateSignedCert(csr *x509.CertificateRequest, cakey *ecdsa.PrivateKey, ...) ([]byte, error)
- func GetCertFingerprint(certder []byte) ([]byte, x509.SignatureAlgorithm)
- func GetCertObject(certder []byte) (*x509.Certificate, error)
- func GetCertPem(cerder []byte) string
- func GetECKeyDer(key *ecdsa.PrivateKey) ([]byte, error)
- func GetECKeyPem(pk *ecdsa.PrivateKey) string
- func GetECKeyPemWithAttr(pk *ecdsa.PrivateKey, curve uint8) string
- func GetECPubKeyDer(key *ecdsa.PrivateKey) ([]byte, error)
- func GetMaxValidity(startval, maxcaval time.Time, validity uint64) time.Duration
- func GetSHA1Hash(in []byte) []byte
- func GetSubKeyID(key *ecdsa.PrivateKey) ([]byte, error)
- func GetSubKeyIDFromPInterface(pubkey interface{}) ([]byte, error)
- func HandleGetCACert(id string) ([]byte, error)
- func HandleSimpleEnrollRequest(id, csr string) ([]byte, error)
- func ParseCSR(csr []byte) (*x509.CertificateRequest, error)
- func PemDecode(in []byte) (*pem.Block, error)
- func PemEncode(in []byte, ptype string) []byte
- func UpdateCSRRole(csr *x509.CertificateRequest, enrollItem *cdb.EnrollTable)
- func UpdateCSRSubName(csr *x509.CertificateRequest, enrollItem *cdb.EnrollTable, ...)
- func ValidateCSR(csr *x509.CertificateRequest) bool
- type CAServer
- type DN
Constants ¶
View Source
const ( CurveP256 = 0 CurveP384 = 1 CurveP521 = 2 )
Variables ¶
View Source
var CAServerMap map[string]*CAServer
View Source
var CurveP256OID asn1.ObjectIdentifier = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7}
View Source
var CurveP384OID asn1.ObjectIdentifier = asn1.ObjectIdentifier{1, 3, 132, 0, 34}
View Source
var CurveP521OID asn1.ObjectIdentifier = asn1.ObjectIdentifier{1, 3, 132, 0, 35}
View Source
var RoleLabel string = "roleName"
View Source
var RoleName asn1.ObjectIdentifier = asn1.ObjectIdentifier{2, 5, 29, 9}
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func GenerateECCSR ¶
func GenerateECCSR(csr *config.CertAttributes, key *ecdsa.PrivateKey, sigalgo uint) ([]byte, error)
func GenerateECKey ¶
func GenerateECKey(curve uint8) (*ecdsa.PrivateKey, error)
func GenerateSelfSignedCert ¶
func GenerateSelfSignedCert(csr *config.CertAttributes, key *ecdsa.PrivateKey, sigalgo uint, validity uint64, serial int64) ([]byte, error)
func GenerateSignedCert ¶
func GenerateSignedCert(csr *x509.CertificateRequest, cakey *ecdsa.PrivateKey, cacert *x509.Certificate, sigalgo uint, validity uint64, serial int64) ([]byte, error)
func GetCertFingerprint ¶
func GetCertFingerprint(certder []byte) ([]byte, x509.SignatureAlgorithm)
func GetCertObject ¶
func GetCertObject(certder []byte) (*x509.Certificate, error)
func GetCertPem ¶
func GetECKeyDer ¶
func GetECKeyDer(key *ecdsa.PrivateKey) ([]byte, error)
func GetECKeyPem ¶
func GetECKeyPem(pk *ecdsa.PrivateKey) string
func GetECKeyPemWithAttr ¶
func GetECKeyPemWithAttr(pk *ecdsa.PrivateKey, curve uint8) string
func GetECPubKeyDer ¶
func GetECPubKeyDer(key *ecdsa.PrivateKey) ([]byte, error)
func GetMaxValidity ¶
func GetSHA1Hash ¶
func GetSubKeyID ¶
func GetSubKeyID(key *ecdsa.PrivateKey) ([]byte, error)
func HandleGetCACert ¶
func UpdateCSRRole ¶
func UpdateCSRRole(csr *x509.CertificateRequest, enrollItem *cdb.EnrollTable)
func UpdateCSRSubName ¶
func UpdateCSRSubName(csr *x509.CertificateRequest, enrollItem *cdb.EnrollTable, profItem *config.CAProfile)
func ValidateCSR ¶
func ValidateCSR(csr *x509.CertificateRequest) bool
Types ¶
Click to show internal directories.
Click to hide internal directories.