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
+15.4k Golang : Find location by IP address and display with Google Map
+11.1k Golang : Read until certain character to break for loop
+5.4k Golang : Qt update UI elements with core.QCoreApplication_ProcessEvents
+9.7k Golang : Detect number of active displays and the display's resolution
+9.2k Golang : How to control fmt or log print format?
+18.4k Golang : Read binary file into memory
+12.7k Golang : Add ASCII art to command line application launching process
+9k Golang : Go as a script or running go with shebang/hashbang style
+51.4k Golang : Check if item is in slice/array
+9.2k Golang : How to find out similarity between two strings with Jaro-Winkler Distance?
+20.2k Golang : Determine if directory is empty with os.File.Readdir() function
+8.1k Golang : Variadic function arguments sanity check example