Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
adityasaky committed Oct 21, 2024
1 parent da79e4b commit 223ef3e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/rekor/rekor.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ func (c *Client) WriteMessage(ctx context.Context, message, signature []byte, ce
}

func (c *Client) get(ctx context.Context, data []byte, cert *x509.Certificate) (*models.LogEntryAnon, error) {
h := sha256.New()
h.Write(data)
hash := hex.EncodeToString(h.Sum(nil))
fmt.Println("PAYLOAD HASH", hash)

pem, err := cryptoutils.MarshalCertificateToPEM(cert)
if err != nil {
return nil, err
Expand Down Expand Up @@ -214,6 +219,7 @@ func extractCerts(e *models.LogEntryAnon) ([]*x509.Certificate, error) {
return nil, err
}
case *hashedrekord_v001.V001Entry:
fmt.Println("HASH", *e.HashedRekordObj.Data.Hash.Value)
publicKeyB64, err = e.HashedRekordObj.Signature.PublicKey.Content.MarshalText()
if err != nil {
return nil, err
Expand Down

0 comments on commit 223ef3e

Please sign in to comment.