Skip to content

Commit

Permalink
Can now use cryptoid Hashes as a signerOpt
Browse files Browse the repository at this point in the history
  • Loading branch information
phayes committed Apr 10, 2016
1 parent 8eb7e4a commit 0692f11
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cryptoid.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ type HashAlgorithm struct {
Hash crypto.Hash
}

// Satisfies crypto.SignerOpts interface for signing digests
// You can use a cryptoid.HashAlgorithm directly when
// using a crypto.Signer interface to sign digests.
func (h HashAlgorithm) HashFunc() crypto.Hash {
return h.Hash
}

type SignatureAlgorithm struct {
Name string
OID asn1.ObjectIdentifier
Expand Down

0 comments on commit 0692f11

Please sign in to comment.