Skip to content

Commit

Permalink
Rename x509ca to pkcs11ca
Browse files Browse the repository at this point in the history
Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
  • Loading branch information
haydentherapper committed Jun 10, 2022
1 parent ea07853 commit 963c9f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cmd/app/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/sigstore/fulcio/pkg/ca/fileca"
googlecav1 "github.com/sigstore/fulcio/pkg/ca/googleca/v1"
"github.com/sigstore/fulcio/pkg/ca/kmsca"
"github.com/sigstore/fulcio/pkg/ca/x509ca"
"github.com/sigstore/fulcio/pkg/ca/pkcs11ca"
"github.com/sigstore/fulcio/pkg/config"
"github.com/sigstore/fulcio/pkg/log"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -177,15 +177,15 @@ func runServeCmd(cmd *cobra.Command, args []string) {
case "googleca":
baseca, err = googlecav1.NewCertAuthorityService(cmd.Context(), viper.GetString("gcp_private_ca_parent"))
case "pkcs11ca":
params := x509ca.Params{
params := pkcs11ca.Params{
ConfigPath: viper.GetString("pkcs11-config-path"),
RootID: viper.GetString("hsm-caroot-id"),
}
if viper.IsSet("aws-hsm-root-ca-path") {
path := viper.GetString("aws-hsm-root-ca-path")
params.CAPath = &path
}
baseca, err = x509ca.NewX509CA(params)
baseca, err = pkcs11ca.NewPKCS11CA(params)
case "fileca":
certFile := viper.GetString("fileca-cert")
keyFile := viper.GetString("fileca-key")
Expand Down
4 changes: 2 additions & 2 deletions pkg/ca/x509ca/x509ca.go → pkg/ca/pkcs11ca/pkcs11ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.
//

package x509ca
package pkcs11ca

import (
"crypto/x509"
Expand All @@ -40,7 +40,7 @@ type PKCS11CA struct {
baseca.BaseCA
}

func NewX509CA(params Params) (*PKCS11CA, error) {
func NewPKCS11CA(params Params) (*PKCS11CA, error) {
pkcs11ca := &PKCS11CA{}
p11Ctx, err := crypto11.ConfigureFromFile(params.ConfigPath)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.
//

package x509ca
package pkcs11ca

import (
"errors"
Expand All @@ -28,8 +28,8 @@ type Params struct {
CAPath *string
}

// NewX509CA is a placeholder for erroring with a meaningful message if the
// NewPKCS11CA is a placeholder for erroring with a meaningful message if the
// binary has been built with CGO_ENABLED=0 tags.
func NewX509CA(params Params) (*X509CA, error) {
func NewPKCS11CA(params Params) (*PKCS11CA, error) {
return nil, errors.New("binary has been built with no cgo support, PKCS11 not supported")
}

0 comments on commit 963c9f8

Please sign in to comment.