mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-27 00:19:36 -05:00
25 lines
701 B
Go
25 lines
701 B
Go
/*
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
package azure
|
|
|
|
import (
|
|
"github.com/edgelesssys/constellation/v2/internal/atls"
|
|
"github.com/edgelesssys/constellation/v2/internal/attestation/azure/snp"
|
|
"github.com/edgelesssys/constellation/v2/internal/attestation/azure/trustedlaunch"
|
|
"github.com/edgelesssys/constellation/v2/internal/attestation/vtpm"
|
|
)
|
|
|
|
// NewIssuer returns an SNP issuer if it can successfully read the idkeydigest from the TPM.
|
|
// Otherwise returns a Trusted Launch issuer.
|
|
func NewIssuer() atls.Issuer {
|
|
if _, err := snp.GetIdKeyDigest(vtpm.OpenVTPM); err == nil {
|
|
return snp.NewIssuer()
|
|
} else {
|
|
return trustedlaunch.NewIssuer()
|
|
}
|
|
}
|