Standard library / crypto/rsa

crypto/rsa.PSSOptions.HashFunc()

Returns the configured hash identifier for crypto.SignerOpts. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func (opts *PSSOptions) HashFunc() crypto.Hash

Return Value

crypto.Hash

Result as described above; check any returned error before use.

Working Example

Example Snippetgo
package main
import (  "crypto"  "crypto/rsa"  "fmt")
func main() { o := &rsa.PSSOptions{Hash: crypto.SHA256}; fmt.Println(o.HashFunc() == crypto.SHA256) }func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}
Go Reference