Golang crypto/x509.InvalidReason type example
package crypto/x509
Golang crypto/x509.InvalidReason type usage example
type CertificateInvalidError struct {
Cert *Certificate
Reason InvalidReason
}
func (e CertificateInvalidError) Error() string {
switch e.Reason {
case NotAuthorizedToSign:
return "x509: certificate is not authorized to sign other certificates"
case Expired:
return "x509: certificate has expired or is not yet valid"
case CANotAuthorizedForThisName:
return "x509: a root or intermediate certificate is not authorized to sign in this domain"
case TooManyIntermediates:
return "x509: too many intermediates for path length constraint"
case IncompatibleUsage:
return "x509: certificate specifies an incompatible key usage"
}
return "x509: unknown error"
}
Reference :
Advertisement
Something interesting
Tutorials
+12.1k Golang : md5 hash of a string
+5.6k PHP : Convert string to timestamp or datestamp before storing to database(MariaDB/MySQL)
+28k Golang : Move file to another directory
+25.7k Golang : How to write CSV data to file
+33k Golang : How to check if a date is within certain range?
+18.5k Golang : Write file with io.WriteString
+11.6k Golang : Concurrency and goroutine example
+18.7k Golang : convert int to string
+15.2k JavaScript/JQuery : Detect or intercept enter key pressed example
+34k Golang : Proper way to set function argument default value
+9.4k Golang : How to protect your source code from client, hosting company or hacker?
+20.8k Golang : Convert date string to variants of time.Time type examples