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
+11.3k Golang : Intercept and process UNIX signals example
+7.5k Golang : Detect sample rate, channels or latency with PortAudio
+9.6k Golang : Sort and reverse sort a slice of floats
+12.7k Golang : Remove or trim extra comma from CSV
+7.1k Golang : Gorrila mux.Vars() function example
+17.5k Golang : Linked list example
+10k CodeIgniter : Load different view for mobile devices
+8.3k Golang : Number guessing game with user input verification example
+25.8k Golang : Daemonizing a simple web server process example
+15.9k Golang : Get file permission