Documentation
¶
Index ¶
- Variables
- func GenerateSSHKey(keyType KeyType, bits int) (ssh.Signer, error)
- func SavePublicKey(signer ssh.Signer, filePath string) error
- func SignUserKey(caSigner ssh.Signer, userPublicKey ssh.PublicKey, principals []string, ...) (*ssh.Certificate, error)
- type CA
- type CaRequest
- type CaResponse
- type CommonCa
- type KeyType
- type SignRequest
- type SignResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var InvalidKeyErr error = errors.New("unsupported key type")
Functions ¶
func GenerateSSHKey ¶
GenerateSSHKey generates a new SSH keypair with a 4096-bit RSA private key
func SavePublicKey ¶
SavePublicKey saves the public key from the SSH signer to a file
Types ¶
type CA ¶
type CA struct {
Name string
Signer ssh.Signer
Bits int
MaxTTLMinutes int
ValidPrincipals []string
}
func (CA) CreateResponse ¶
func (c CA) CreateResponse() *CaResponse
type CaResponse ¶
type CommonCa ¶
type CommonCa struct {
// Name of CA
Name string `json:"name"`
// Type of ca, rsa, ed25519
Type KeyType `json:"type"`
// Key length
Bits int `json:"bits"`
// Maximum TTL certs can be signed for
MaxTTLMinutes int `json:"max_ttl_minutes"`
// List of Valid Principals
ValidPrincipals []string `json:"valid_principals"`
}
type SignRequest ¶
type SignResponse ¶
type SignResponse struct {
// Signed certificate by the CA
SignedKey string `json:"signed_key"`
}
Click to show internal directories.
Click to hide internal directories.