本文整理匯總了Golang中github.com/google/certificate-transparency/go/asn1.ObjectIdentifier.String方法的典型用法代碼示例。如果您正苦於以下問題:Golang ObjectIdentifier.String方法的具體用法?Golang ObjectIdentifier.String怎麽用?Golang ObjectIdentifier.String使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/google/certificate-transparency/go/asn1.ObjectIdentifier
的用法示例。
在下文中一共展示了ObjectIdentifier.String方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: attributeOidToString
func attributeOidToString(oid asn1.ObjectIdentifier) string {
switch {
case oid.Equal(OidCountry):
return "Country"
case oid.Equal(OidOrganization):
return "Organization"
case oid.Equal(OidOrganizationalUnit):
return "OrganizationalUnit"
case oid.Equal(OidCommonName):
return "CommonName"
case oid.Equal(OidSerialNumber):
return "SerialNumber"
case oid.Equal(OidLocality):
return "Locality"
case oid.Equal(OidProvince):
return "Province"
case oid.Equal(OidStreetAddress):
return "StreetAddress"
case oid.Equal(OidPostalCode):
return "PostalCode"
case oid.Equal(OidPseudonym):
return "Pseudonym"
case oid.Equal(OidTitle):
return "Title"
case oid.Equal(OidDnQualifier):
return "DnQualifier"
case oid.Equal(OidName):
return "Name"
case oid.Equal(OidSurname):
return "Surname"
case oid.Equal(OidGivenName):
return "GivenName"
case oid.Equal(OidInitials):
return "Initials"
case oid.Equal(OidGenerationQualifier):
return "GenerationQualifier"
default:
return oid.String()
}
}