github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/pki/signer_test.go (about)

     1  // Copyright 2020 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package pki_test
     5  
     6  import (
     7  	gc "gopkg.in/check.v1"
     8  
     9  	"github.com/juju/juju/pki"
    10  )
    11  
    12  type SignerSuite struct {
    13  }
    14  
    15  var _ = gc.Suite(&SignerSuite{})
    16  
    17  func (s *SignerSuite) TestKeyProfilesForErrors(c *gc.C) {
    18  	tests := []struct {
    19  		name    string
    20  		profile pki.KeyProfile
    21  	}{
    22  		{name: "ecdsa224", profile: pki.ECDSAP224},
    23  		{name: "ecdsa256", profile: pki.ECDSAP256},
    24  		{name: "ecdsa384", profile: pki.ECDSAP384},
    25  		{name: "rsa3072", profile: pki.RSA3072},
    26  	}
    27  
    28  	for _, test := range tests {
    29  		if _, err := test.profile(); err != nil {
    30  			c.Errorf("failed running test for profile %s: %v", test.name, err)
    31  		}
    32  	}
    33  }