Skip to content

Commit

Permalink
base64 decode SignedRFC3161Timestamp
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry S <[email protected]>
  • Loading branch information
dmitris committed Nov 4, 2024
1 parent cb540ab commit 56fdb7f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/oci-image-verification/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,16 @@ func getVerificationMaterialTimestampEntries(manifestLayer *v1.Descriptor) (*pro
if _, ok := keyValPairs["SignedRFC3161Timestamp"]; !ok {
return nil, errors.New("error getting SignedRFC3161Timestamp from key/value pairs")
}
// 4. Decode the base64 encoded timestamp
der, err := base64.StdEncoding.DecodeString(keyValPairs["SignedRFC3161Timestamp"])
if err != nil {
return nil, fmt.Errorf("error decoding base64 encoded timestamp: %w", err)
}
// 4. Construct the timestamp entry list
return &protobundle.TimestampVerificationData{
Rfc3161Timestamps: []*protocommon.RFC3161SignedTimestamp{
{
SignedTimestamp: []byte(keyValPairs["SignedRFC3161Timestamp"]),
SignedTimestamp: der,
},
},
}, nil
Expand Down

0 comments on commit 56fdb7f

Please sign in to comment.