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
+26.4k Golang : Get executable name behind process ID example
+6.9k Golang : Calculate BMI and risk category
+6.3k PHP : How to handle URI or URL with non-ASCII characters such as Chinese/Japanese/Korean(CJK) ?
+4.4k Linux/MacOSX : Search and delete files by extension
+6k Linux/MacOSX : Search for files by filename and extension with find command
+8.8k Golang : Accept any number of function arguments with three dots(...)
+19.2k Golang : Populate dropdown with html/template example
+16.3k Golang : Find out mime type from bytes in buffer
+8.2k How to show different content from website server when AdBlock is detected?
+10k Golang : Setting variable value with ldflags
+4.7k Linux/MacOSX : How to symlink a file?
+10.8k Golang : Natural string sorting example