Made CertWithAlias type nonexportable.

This commit is contained in:
Christopher Denny
2016-06-07 13:12:15 -07:00
parent 248a04a234
commit 01131ea73e
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ Serial Number: {{.SerialNumber}} {{end}}
// (for jckes certs, blank otherwise), and prints out relevant
// information. Start and end dates are colored based on whether or not
// the certificate is expired, not expired, or close to expiring.
func displayCert(cert CertWithAlias) {
func displayCert(cert certWithAlias) {
funcMap := template.FuncMap{
"hexify": hexify,
"certStart": certStart,
+7 -7
View File
@@ -47,7 +47,7 @@ var fileExtToFormat = map[string]string{
".jceks": "JCEKS",
}
type CertWithAlias struct {
type certWithAlias struct {
alias string
cert *x509.Certificate
}
@@ -91,8 +91,8 @@ func formatForFile(filename, format string) (string, bool) {
// is specified for the file, getCerts guesses what format was used
// based on the file extension used in the file name. If it can't
// guess based on this it returns and error.
func getCerts(file, format string) ([]CertWithAlias, error) {
var certs []CertWithAlias
func getCerts(file, format string) ([]certWithAlias, error) {
var certs []certWithAlias
data, _ := ioutil.ReadFile(file)
switch format {
case "PEM":
@@ -102,7 +102,7 @@ func getCerts(file, format string) ([]CertWithAlias, error) {
if err != nil {
return nil, err
}
certs = append(certs, CertWithAlias{cert: cert})
certs = append(certs, certWithAlias{cert: cert})
block, data = pem.Decode(data)
}
case "PKCS12":
@@ -119,7 +119,7 @@ func getCerts(file, format string) ([]CertWithAlias, error) {
if err != nil {
return nil, err
}
certs = append(certs, CertWithAlias{cert: cert})
certs = append(certs, certWithAlias{cert: cert})
}
}
case "JCEKS":
@@ -135,7 +135,7 @@ func getCerts(file, format string) ([]CertWithAlias, error) {
if err != nil {
return nil, err
}
certs = append(certs, CertWithAlias{cert: cert, alias: alias})
certs = append(certs, certWithAlias{cert: cert, alias: alias})
}
for _, alias := range keyStore.ListPrivateKeys() {
fmt.Printf("Enter password for alias [%s]: ", alias)
@@ -145,7 +145,7 @@ func getCerts(file, format string) ([]CertWithAlias, error) {
return nil, err
}
for _, cert := range certArr {
certs = append(certs, CertWithAlias{cert: cert, alias: alias})
certs = append(certs, certWithAlias{cert: cert, alias: alias})
}
}
default: