Standard library / crypto

crypto.DecrypterOpts

Empty interface for algorithm-specific decryption settings. For RSA OAEP, use *rsa.OAEPOptions with the same hash and label as encryption; do not assume arbitrary options are accepted. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
type DecrypterOpts any

Working Example

Example Snippetgo
package main
import (  "crypto"  "crypto/rsa"  "fmt")
func main() {  var opts crypto.DecrypterOpts = &rsa.OAEPOptions{Hash: crypto.SHA256}  fmt.Println(opts.(*rsa.OAEPOptions).Hash == crypto.SHA256)}
Go Reference