Skip to content
Snippets Groups Projects
Unverified Commit e5dcf0a5 authored by asraa's avatar asraa Committed by GitHub
Browse files

base64 encode timestamping cert chain (#340)


Signed-off-by: default avatarAsra Ali <asraa@google.com>
parent 710784c4
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@ import (
"context"
"crypto/sha256"
"crypto/x509"
"encoding/base64"
"encoding/hex"
"encoding/pem"
"fmt"
......@@ -114,9 +115,12 @@ func NewAPI() (*API, error) {
}
var certChain []*x509.Certificate
certChainStr := viper.GetString("rekor_server.timestamp_chain")
if certChainStr != "" {
var err error
b64CertChainStr := viper.GetString("rekor_server.timestamp_chain")
if b64CertChainStr != "" {
certChainStr, err := base64.StdEncoding.DecodeString(b64CertChainStr)
if err != nil {
return nil, errors.Wrap(err, "decoding timestamping cert")
}
if certChain, err = pki.ParseTimestampCertChain([]byte(certChainStr)); err != nil {
return nil, errors.Wrap(err, "parsing timestamp cert chain")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment