Documentation ¶
Overview ¶
(C) Copyright 2021 Hewlett Packard Enterprise Development LP
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
(C) Copyright 2021 Hewlett Packard Enterprise Development LP
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
(C) Copyright 2021 Hewlett Packard Enterprise Development LP
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
(C) Copyright 2021 Hewlett Packard Enterprise Development LP
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func CreateSigningRequest(ctx context.Context, kgen *keygen.Keygen, rw io.ReadWriter) (request *SigningRequest, resources *RequestResources, err error)
- func GetSignatureScheme(pub tpm2.Public) (*tpm2.SigScheme, error)
- func HashAndSign(rw io.ReadWriter, hierarchy tpmutil.Handle, keyHandle tpmutil.Handle, ...) ([]byte, error)
- type KeyError
- type RequestResources
- type SigningRequest
- type SigningResponse
Constants ¶
const EKRSACertificateHandle = tpmutil.Handle(0x01c00002)
Variables ¶
var ( ErrNotSigningKey = KeyError{Reason: "not a signing key"} ErrBadKeyFormat = KeyError{Reason: "malformed key"} )
var ErrTrailingData = errors.New("ASN.1 trailing data")
Functions ¶
func CreateSigningRequest ¶
func CreateSigningRequest(ctx context.Context, kgen *keygen.Keygen, rw io.ReadWriter) (request *SigningRequest, resources *RequestResources, err error)
Types ¶
type RequestResources ¶
type RequestResources struct { Attestation *keygen.KeyInfo Endorsement *keygen.KeyInfo DevID *keygen.KeyInfo // contains filtered or unexported fields }
func (*RequestResources) Activate ¶
func (rh *RequestResources) Activate(credentialBlob, secret []byte) ([]byte, error)
func (*RequestResources) Flush ¶
func (rh *RequestResources) Flush()
type SigningRequest ¶
type SigningRequest struct { PlatformIdentity pkix.RDNSequence EndorsementCertificate *x509.Certificate EndorsementKey *tpm2.Public AttestationKey *tpm2.Public DevIDKey *tpm2.Public CertifyData []byte CertifySignature []byte }
func (*SigningRequest) MarshalBinary ¶
func (sr *SigningRequest) MarshalBinary() (data []byte, err error)
MarshalBinary implements encoding.BinaryMarshaler
func (*SigningRequest) UnmarshalBinary ¶
func (sr *SigningRequest) UnmarshalBinary(data []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler
type SigningResponse ¶
type SigningResponse struct { AttestationCertificate *x509.Certificate DevIDCertificate *x509.Certificate }
func (*SigningResponse) MarshalBinary ¶
func (sr *SigningResponse) MarshalBinary() (data []byte, err error)
MarshalBinary implements encoding.BinaryMarshaler
func (*SigningResponse) UnmarshalBinary ¶
func (sr *SigningResponse) UnmarshalBinary(data []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler