Documentation ¶
Index ¶
- func GenerateCertificate(rootKey data.PrivateKey, gun string) (*x509.Certificate, error)
- type CryptoService
- func (ccs *CryptoService) Create(role, algorithm string) (data.PublicKey, error)
- func (ccs *CryptoService) GetKey(keyID string) data.PublicKey
- func (ccs *CryptoService) GetPrivateKey(keyID string) (k data.PrivateKey, id string, err error)
- func (ccs *CryptoService) ListKeys(role string) []string
- func (ccs *CryptoService) RemoveKey(keyID string) (err error)
- func (ccs *CryptoService) Sign(keyIDs []string, payload []byte) ([]data.Signature, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCertificate ¶
func GenerateCertificate(rootKey data.PrivateKey, gun string) (*x509.Certificate, error)
GenerateCertificate generates an X509 Certificate from a template, given a GUN
Types ¶
type CryptoService ¶
type CryptoService struct {
// contains filtered or unexported fields
}
CryptoService implements Sign and Create, holding a specific GUN and keystore to operate on
func NewCryptoService ¶
func NewCryptoService(gun string, keyStores ...trustmanager.KeyStore) *CryptoService
NewCryptoService returns an instance of CryptoService
func (*CryptoService) Create ¶
func (ccs *CryptoService) Create(role, algorithm string) (data.PublicKey, error)
Create is used to generate keys for targets, snapshots and timestamps
func (*CryptoService) GetKey ¶
func (ccs *CryptoService) GetKey(keyID string) data.PublicKey
GetKey returns a key by ID
func (*CryptoService) GetPrivateKey ¶
func (ccs *CryptoService) GetPrivateKey(keyID string) (k data.PrivateKey, id string, err error)
GetPrivateKey returns a private key by ID
func (*CryptoService) ListKeys ¶
func (ccs *CryptoService) ListKeys(role string) []string
ListKeys returns a list of key IDs valid for the given role
func (*CryptoService) RemoveKey ¶
func (ccs *CryptoService) RemoveKey(keyID string) (err error)
RemoveKey deletes a key by ID
Click to show internal directories.
Click to hide internal directories.