Documentation ¶
Overview ¶
Package legacyx509 is a copy of certain parts of Go's crypto/x509 package. It is based on Go 1.23, and has just the parts copied over required for parsing X509 certificates.
The copy in this repository is intended to be used for preparing a SCEP request emulating a Windows SCEP client. The Windows SCEP client marks the authority key identifier as critical in the self-signed SCEP enrolment certificate, which fails to parse using the standard X509 parser in Go 1.23 and later.
This is itself a copy from the copy in our PKCS7 package. We currently don't intend to maintain that in an importable package, since we only need these copies for testing purposes, hence needing another copy of the code.
Index ¶
- func ParseCertificates(der []byte) ([]*stdx509.Certificate, error)
- type ExtKeyUsage
- type KeyUsage
- type OID
- func (o OID) AppendBinary(b []byte) ([]byte, error)
- func (o OID) AppendText(b []byte) ([]byte, error)
- func (oid OID) Equal(other OID) bool
- func (oid OID) EqualASN1OID(other asn1.ObjectIdentifier) bool
- func (o OID) MarshalBinary() ([]byte, error)
- func (o OID) MarshalText() ([]byte, error)
- func (oid OID) String() string
- func (o *OID) UnmarshalBinary(b []byte) error
- func (o *OID) UnmarshalText(text []byte) error
- type PublicKeyAlgorithm
- type SignatureAlgorithm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCertificates ¶
func ParseCertificates(der []byte) ([]*stdx509.Certificate, error)
ParseCertificates parses one or more certificates from the given ASN.1 DER data. The certificates must be concatenated with no intermediate padding.
Types ¶
type ExtKeyUsage ¶
type ExtKeyUsage int
ExtKeyUsage represents an extended set of actions that are valid for a given key. Each of the ExtKeyUsage* constants define a unique action.
const ( ExtKeyUsageAny ExtKeyUsage = iota ExtKeyUsageServerAuth ExtKeyUsageClientAuth ExtKeyUsageCodeSigning ExtKeyUsageEmailProtection ExtKeyUsageIPSECEndSystem ExtKeyUsageIPSECTunnel ExtKeyUsageIPSECUser ExtKeyUsageTimeStamping ExtKeyUsageOCSPSigning ExtKeyUsageMicrosoftServerGatedCrypto ExtKeyUsageNetscapeServerGatedCrypto ExtKeyUsageMicrosoftCommercialCodeSigning ExtKeyUsageMicrosoftKernelCodeSigning )
type KeyUsage ¶
type KeyUsage int
KeyUsage represents the set of actions that are valid for a given key. It's a bitmap of the KeyUsage* constants.
type OID ¶
type OID struct {
// contains filtered or unexported fields
}
An OID represents an ASN.1 OBJECT IDENTIFIER.
func OIDFromInts ¶
OIDFromInts creates a new OID using ints, each integer is a separate component.
func ParseOID ¶
ParseOID parses a Object Identifier string, represented by ASCII numbers separated by dots.
func (OID) AppendBinary ¶
AppendBinary implements encoding.BinaryAppender
func (OID) AppendText ¶
AppendText implements encoding.TextAppender
func (OID) EqualASN1OID ¶
func (oid OID) EqualASN1OID(other asn1.ObjectIdentifier) bool
EqualASN1OID returns whether an OID equals an asn1.ObjectIdentifier. If asn1.ObjectIdentifier cannot represent the OID specified by oid, because a component of OID requires more than 31 bits, it returns false.
func (OID) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler
func (OID) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*OID) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler
func (*OID) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler
type PublicKeyAlgorithm ¶
type PublicKeyAlgorithm int
const ( UnknownPublicKeyAlgorithm PublicKeyAlgorithm = iota RSA DSA // Only supported for parsing. ECDSA Ed25519 )
func (PublicKeyAlgorithm) String ¶
func (algo PublicKeyAlgorithm) String() string
type SignatureAlgorithm ¶
type SignatureAlgorithm int
const ( UnknownSignatureAlgorithm SignatureAlgorithm = iota MD2WithRSA // Unsupported. MD5WithRSA // Only supported for signing, not verification. SHA1WithRSA // Only supported for signing, and verification of CRLs, CSRs, and OCSP responses. SHA256WithRSA SHA384WithRSA SHA512WithRSA DSAWithSHA1 // Unsupported. DSAWithSHA256 // Unsupported. ECDSAWithSHA1 // Only supported for signing, and verification of CRLs, CSRs, and OCSP responses. ECDSAWithSHA256 ECDSAWithSHA384 ECDSAWithSHA512 SHA256WithRSAPSS SHA384WithRSAPSS SHA512WithRSAPSS PureEd25519 )
func (SignatureAlgorithm) String ¶
func (algo SignatureAlgorithm) String() string