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
+13.6k Golang : Get user input until a command or receive a word to stop
+13.1k Golang : How to get a user home directory path?
+11.3k Golang : How to use if, eq and print properly in html template
+15.6k Chrome : ERR_INSECURE_RESPONSE and allow Chrome browser to load insecure content
+16.4k Golang : Convert slice to array
+4.8k Golang : A program that contain another program and executes it during run-time
+8.1k Golang : Variadic function arguments sanity check example
+12.6k Golang : Drop cookie to visitor's browser and http.SetCookie() example
+8.2k Android Studio : Rating bar example
+13.7k Golang : Check if an integer is negative or positive
+22.6k Generate checksum for a file in Go
+25.6k Golang : convert rune to integer value