Documentation ¶
Index ¶
- func AdditionalEKCerts(ek *x509.Certificate) ([]*x509.Certificate, error)
- func EncryptEKInfo(ek, ra *x509.Certificate) ([]byte, error)
- func GenerateAttestationKeyCSR(in *AttestationKeyCSR) ([]byte, error)
- func GenerateAttestationStatement(stmt *AttestationStatement) ([]byte, error)
- func GenerateEKInfo(ek *x509.Certificate) ([]byte, error)
- func MakeCACert(subject crypto.PublicKey, issuer crypto.PrivateKey, ...) (*x509.Certificate, []byte, error)
- func MakeClientCert(subject crypto.PublicKey, issuer crypto.PrivateKey) (*x509.Certificate, []byte, error)
- func MakeRAEncryptionCert(subject crypto.PublicKey, issuer crypto.PrivateKey, ...) (*x509.Certificate, []byte, error)
- func MakeRASigningCert(subject crypto.PublicKey, issuer crypto.PrivateKey, ...) (*x509.Certificate, []byte, error)
- func MakeRootCert(subject crypto.PublicKey, issuer crypto.PrivateKey) (*x509.Certificate, []byte, error)
- func MakeSSLCert(subject crypto.PublicKey, issuer crypto.PrivateKey) (*x509.Certificate, []byte, error)
- func ParseEKInfo(data []byte) (*x509.Certificate, error)
- func ValidateCACert(cert *x509.Certificate) error
- func ValidateClientCert(cert *x509.Certificate) error
- func ValidateRAEncryptionCert(cert *x509.Certificate) error
- func ValidateRASigningCert(cert *x509.Certificate) error
- func ValidateRootCert(cert *x509.Certificate) error
- type AK
- type AttestationKeyCSR
- type AttestationKeyChallenge
- type AttestationKeyChallengeHdr
- type AttestationStatement
- type AttestationStatementHdr
- type ClientContext
- type CreationAttestation
- type GetCertInner
- type GetCertReq
- type GetCertReqBuilder
- type GetCertRsp
- type GetCertRspBuilder
- type GetChallengeReply
- type GetChallengeReq
- type GetChallengeReqBuilder
- type GetChallengeRsp
- type GetChallengeRspBuilder
- type IDBinding
- type TPMInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdditionalEKCerts ¶
func AdditionalEKCerts(ek *x509.Certificate) ([]*x509.Certificate, error)
func EncryptEKInfo ¶
func EncryptEKInfo(ek, ra *x509.Certificate) ([]byte, error)
func GenerateAttestationKeyCSR ¶
func GenerateAttestationKeyCSR(in *AttestationKeyCSR) ([]byte, error)
func GenerateAttestationStatement ¶
func GenerateAttestationStatement(stmt *AttestationStatement) ([]byte, error)
func GenerateEKInfo ¶
func GenerateEKInfo(ek *x509.Certificate) ([]byte, error)
func MakeCACert ¶
func MakeCACert(subject crypto.PublicKey, issuer crypto.PrivateKey, issuerCert *x509.Certificate) (*x509.Certificate, []byte, error)
func MakeClientCert ¶
func MakeClientCert(subject crypto.PublicKey, issuer crypto.PrivateKey) (*x509.Certificate, []byte, error)
func MakeRAEncryptionCert ¶
func MakeRAEncryptionCert(subject crypto.PublicKey, issuer crypto.PrivateKey, issuerCert *x509.Certificate) (*x509.Certificate, []byte, error)
func MakeRASigningCert ¶
func MakeRASigningCert(subject crypto.PublicKey, issuer crypto.PrivateKey, issuerCert *x509.Certificate) (*x509.Certificate, []byte, error)
func MakeRootCert ¶
func MakeRootCert(subject crypto.PublicKey, issuer crypto.PrivateKey) (*x509.Certificate, []byte, error)
func MakeSSLCert ¶
func MakeSSLCert(subject crypto.PublicKey, issuer crypto.PrivateKey) (*x509.Certificate, []byte, error)
func ParseEKInfo ¶
func ParseEKInfo(data []byte) (*x509.Certificate, error)
func ValidateCACert ¶
func ValidateCACert(cert *x509.Certificate) error
func ValidateClientCert ¶
func ValidateClientCert(cert *x509.Certificate) error
func ValidateRAEncryptionCert ¶
func ValidateRAEncryptionCert(cert *x509.Certificate) error
func ValidateRASigningCert ¶
func ValidateRASigningCert(cert *x509.Certificate) error
func ValidateRootCert ¶
func ValidateRootCert(cert *x509.Certificate) error
Types ¶
type AttestationKeyCSR ¶
type AttestationKeyCSR struct { SubjectPublicKey crypto.PublicKey SubjectKeyID []byte OSVersion string SCEPSignerHash []byte MachineName string UserName string AttestationStatement EncryptedEKCerts []byte TPMInfo }
func ParseAttestationKeyCSR ¶
func ParseAttestationKeyCSR(data []byte, scepCert *x509.Certificate) (*AttestationKeyCSR, error)
type AttestationKeyChallenge ¶
type AttestationKeyChallenge struct { CredentialBlob []byte Secret []byte ServerContextBlob asn1.RawValue }
func ParseAttestationKeyChallenge ¶
func ParseAttestationKeyChallenge(data []byte) (*AttestationKeyChallenge, error)
type AttestationStatement ¶
type AttestationStatement struct { Header AttestationStatementHdr IDBinding KeyAttestation []byte AIKOpaque []byte }
type AttestationStatementHdr ¶
type ClientContext ¶
type ClientContext struct {
// contains filtered or unexported fields
}
func NewClientContext ¶
func NewClientContext() (*ClientContext, error)
func (*ClientContext) AttestationStatement ¶
func (cli *ClientContext) AttestationStatement() (*AttestationStatement, crypto.PublicKey, error)
func (*ClientContext) Close ¶
func (cli *ClientContext) Close()
func (*ClientContext) DecryptChallenge ¶
func (cli *ClientContext) DecryptChallenge(challenge *AttestationKeyChallenge) ([]byte, error)
func (*ClientContext) GetAKCert ¶
func (cli *ClientContext) GetAKCert() (template, cert []byte, err error)
type CreationAttestation ¶
type CreationAttestation struct { CreationData tpm2.CreationData Attest tpm2.AttestationData // This could be a tpm2.Signature, if an Encode() function were available for that type. // TODO: add that, and upstream it. SignatureAlg tpm2.Algorithm Signature tpm2.SignatureRSA }
type GetCertInner ¶
type GetCertReq ¶
func ParseGetCertReq ¶
func ParseGetCertReq(data []byte) (*GetCertReq, error)
type GetCertReqBuilder ¶
type GetCertReqBuilder struct { Challenge *AttestationKeyChallenge DecryptedChallenge []byte SignerCert *x509.Certificate SignerKey crypto.PrivateKey RecipientCert *x509.Certificate }
func (GetCertReqBuilder) Build ¶
func (b GetCertReqBuilder) Build() ([]byte, error)
type GetCertRsp ¶
func ParseGetCertRsp ¶
func ParseGetCertRsp(data []byte) (*GetCertRsp, error)
func (GetCertRsp) DecryptCert ¶
func (rsp GetCertRsp) DecryptCert(cert *x509.Certificate, key crypto.PrivateKey) ([]byte, error)
type GetCertRspBuilder ¶
type GetCertRspBuilder struct { Cert []byte SignerCert *x509.Certificate SignerKey crypto.PrivateKey RecipientCert *x509.Certificate }
func (GetCertRspBuilder) Build ¶
func (b GetCertRspBuilder) Build() ([]byte, error)
type GetChallengeReply ¶
type GetChallengeReply struct { EKChallenge struct { OID asn1.ObjectIdentifier Contents struct { Challenge []byte } `asn1:"set"` } ServerContext asn1.RawValue }
type GetChallengeReq ¶
func ParseGetChallengeReq ¶
func ParseGetChallengeReq(data []byte) (*GetChallengeReq, error)
func (GetChallengeReq) DecryptCSR ¶
func (req GetChallengeReq) DecryptCSR(cert, scepCert *x509.Certificate, key crypto.PrivateKey) (*AttestationKeyCSR, error)
func (*GetChallengeReq) SCEPCert ¶
func (req *GetChallengeReq) SCEPCert() *x509.Certificate
type GetChallengeReqBuilder ¶
type GetChallengeReqBuilder struct { Claims []byte ExtraEKCerts []*x509.Certificate SignerCert *x509.Certificate SignerKey crypto.PrivateKey RecipientCert *x509.Certificate }
func (GetChallengeReqBuilder) Build ¶
func (b GetChallengeReqBuilder) Build() ([]byte, error)
type GetChallengeRsp ¶
func ParseGetChallengeRsp ¶
func ParseGetChallengeRsp(data []byte) (*GetChallengeRsp, error)
func (GetChallengeRsp) DecryptChallenge ¶
func (rsp GetChallengeRsp) DecryptChallenge(cert *x509.Certificate, key crypto.PrivateKey) (*AttestationKeyChallenge, error)
type GetChallengeRspBuilder ¶
type GetChallengeRspBuilder struct { Challenge []byte SenderNonce []byte TransactionID string SignerCert *x509.Certificate SignerKey crypto.PrivateKey RecipientCert *x509.Certificate }
func (GetChallengeRspBuilder) Build ¶
func (b GetChallengeRspBuilder) Build() ([]byte, error)
type IDBinding ¶
type IDBinding struct { Public tpm2.Public CreationAttestation }
Click to show internal directories.
Click to hide internal directories.