55 lines
858 B
Go
55 lines
858 B
Go
package x509
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type AlgorithmIdentifier struct {
|
|
Kind []uint64
|
|
Name string
|
|
parameters []byte // ?
|
|
}
|
|
|
|
type Attribute struct {
|
|
Kind []uint64
|
|
Name string
|
|
Value []byte
|
|
}
|
|
|
|
type ValiditySpan struct {
|
|
NotBefore time.Time
|
|
NotAfter time.Time
|
|
}
|
|
|
|
type SubjectPublicKeyInfo struct {
|
|
Algorithm AlgorithmIdentifier
|
|
// Key []byte
|
|
Modulus []byte
|
|
Exponent uint64
|
|
}
|
|
|
|
type Extension struct {
|
|
Kind []uint64
|
|
Name string
|
|
Critical bool
|
|
Value []byte
|
|
}
|
|
|
|
type TBSCertificate struct {
|
|
Version uint8
|
|
Serial []byte
|
|
Signature AlgorithmIdentifier
|
|
Issuer []Attribute
|
|
Validity ValiditySpan
|
|
Subject []Attribute
|
|
SubjectPublicKey SubjectPublicKeyInfo
|
|
// issuer_uid []byte
|
|
// subject_uid []byte
|
|
Exts []Extension
|
|
}
|
|
|
|
type Certificate struct {
|
|
Data TBSCertificate
|
|
SignatureAlgo AlgorithmIdentifier
|
|
SignatureValue []byte
|
|
}
|