Documentation
¶
Index ¶
- Constants
- Variables
- func Fingerprint(certDER []byte) string
- func OIDToString(bytes []byte) string
- func PEMToBase64(cert string) string
- func PEMToDER(cert string) ([]byte, error)
- func ParseStructure(certDER []byte, prettyPrint bool) (string, error)
- func ParseStructureRec(bytes []byte) (structure []string, err error)
- type Byte
- type ParseError
Constants ¶
View Source
const ( // Types BOOLEAN = 0x01 INTEGER = 0x02 BIT_STRING = 0x03 OCTET_STRING = 0x04 NULL = 0x05 OBJECT_IDENTIFIER = 0x06 OBJECT_DESCRIPTOR = 0x07 EXTERNAL = 0x08 REAL = 0x09 UTF8_STRING = 0x0C PRINTABLE_STRING = 0x13 IA5STRING = 0x16 UTC_TIME = 0x17 GENERALIZED_TIME = 0x18 SEQUENCE = 0x30 SET = 0x31 VERSION = 0xA0 ISSUER_UNIQUE_ID = 0xA1 SUBJECT_UNIQUE_ID = 0xA2 EXTENSION = 0xA3 // Object identifiers used in X.509 certificates KEY_USAGE = 0x551D0F EXT_KEY_USAGE = 0x551D25 BASIC_CONSTRAINTS = 0x551D13 AUTHORITY_INFO_ACCESS = 0x2B06010505070101 CERTIFICATE_POLICIES = 0x551D20 CRL_DISTRIBUTION_POINTS = 0x0551D1F )
Variables ¶
View Source
var TYPE = map[int]string{ BOOLEAN: `"BOOLEAN"`, INTEGER: `"INTEGER"`, BIT_STRING: `"BIT_STRING"`, OCTET_STRING: `"OCTET_STRING"`, NULL: `"NULL"`, OBJECT_IDENTIFIER: `"OBJECT_IDENTIFIER"`, OBJECT_DESCRIPTOR: `"OBJECT_DESCRIPTOR"`, EXTERNAL: `"EXTERNAL"`, REAL: `"REAL"`, UTF8_STRING: `"UTF8_STRING"`, PRINTABLE_STRING: `"PRINTABLE_STRING"`, IA5STRING: `"IA5STRING"`, UTC_TIME: `"UTC_TIME"`, GENERALIZED_TIME: `"GENERALIZED_TIME"`, SEQUENCE: `"SEQUENCE"`, SET: `"SET"`, VERSION: `"VERSION"`, ISSUER_UNIQUE_ID: `"ISSUER_UNIQUE_ID"`, SUBJECT_UNIQUE_ID: `"SUBJECT_UNIQUE_ID"`, EXTENSION: `"EXTENSION"`, }
Functions ¶
func Fingerprint ¶
func OIDToString ¶
func PEMToBase64 ¶
func ParseStructureRec ¶
Given the bytes of a DER encoded X.509 certificate, returns an array of bytes that is unique to the ASN1 structure of the certificate and does not depend on the contents of the certificate.
Types ¶
type ParseError ¶
type ParseError struct {
Msg string
}
func (*ParseError) Error ¶
func (e *ParseError) Error() string
Click to show internal directories.
Click to hide internal directories.