Formatted.

pull/862/head
Carl Tashian 2 years ago
parent a13e58e340
commit 1ba1584c7a

@ -81,13 +81,12 @@ type Authority struct {
} }
type AuthorityInfo struct { type AuthorityInfo struct {
StartTime time.Time StartTime time.Time
RootX509Certs []*x509.Certificate RootX509Certs []*x509.Certificate
SSHCAUserPublicKey []byte SSHCAUserPublicKey []byte
SSHCAHostPublicKey []byte SSHCAHostPublicKey []byte
} }
// New creates and initiates a new Authority type. // New creates and initiates a new Authority type.
func New(cfg *config.Config, opts ...Option) (*Authority, error) { func New(cfg *config.Config, opts ...Option) (*Authority, error) {
err := cfg.Validate() err := cfg.Validate()
@ -569,7 +568,7 @@ func (a *Authority) GetAdminDatabase() admin.DB {
func (a *Authority) GetInfo() AuthorityInfo { func (a *Authority) GetInfo() AuthorityInfo {
ai := AuthorityInfo{ ai := AuthorityInfo{
StartTime: a.startTime, StartTime: a.startTime,
RootX509Certs: a.rootX509Certs, RootX509Certs: a.rootX509Certs,
} }
if a.sshCAUserCertSignKey != nil { if a.sshCAUserCertSignKey != nil {

@ -1,9 +1,9 @@
package ca package ca
import ( import (
"crypto/sha256"
"crypto/tls" "crypto/tls"
"crypto/x509" "crypto/x509"
"crypto/sha256"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"log" "log"
@ -302,8 +302,8 @@ func (ca *CA) Run() error {
authorityInfo := ca.auth.GetInfo() authorityInfo := ca.auth.GetInfo()
log.Printf("Address: %s", ca.config.Address) log.Printf("Address: %s", ca.config.Address)
for _, crt := range authorityInfo.RootX509Certs { for _, crt := range authorityInfo.RootX509Certs {
sum := sha256.Sum256(crt.Raw) sum := sha256.Sum256(crt.Raw)
log.Printf("X.509 Root Fingerprint: %s", hex.EncodeToString(sum[:])) log.Printf("X.509 Root Fingerprint: %s", hex.EncodeToString(sum[:]))
} }
if authorityInfo.SSHCAHostPublicKey != nil { if authorityInfo.SSHCAHostPublicKey != nil {
log.Printf("SSH Host CA Key: %s\n", authorityInfo.SSHCAHostPublicKey) log.Printf("SSH Host CA Key: %s\n", authorityInfo.SSHCAHostPublicKey)

Loading…
Cancel
Save