devid

package
v0.0.0-...-b912ef2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

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

View Source
const EKRSACertificateHandle = tpmutil.Handle(0x01c00002)

Variables

View Source
var (
	ErrNotSigningKey = KeyError{Reason: "not a signing key"}
	ErrBadKeyFormat  = KeyError{Reason: "malformed key"}
)
View Source
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)

func GetSignatureScheme

func GetSignatureScheme(pub tpm2.Public) (*tpm2.SigScheme, error)

func HashAndSign

func HashAndSign(
	rw io.ReadWriter,
	hierarchy tpmutil.Handle,
	keyHandle tpmutil.Handle,
	data []byte,
) ([]byte, error)

Types

type KeyError

type KeyError struct {
	Reason string
}

func (KeyError) Error

func (e KeyError) Error() string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL