• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang asn1.ObjectIdentifier类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/google/certificate-transparency/go/asn1.ObjectIdentifier的典型用法代码示例。如果您正苦于以下问题:Golang ObjectIdentifier类的具体用法?Golang ObjectIdentifier怎么用?Golang ObjectIdentifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ObjectIdentifier类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: extKeyUsageFromOID

func extKeyUsageFromOID(oid asn1.ObjectIdentifier) (eku ExtKeyUsage, ok bool) {
	for _, pair := range extKeyUsageOIDs {
		if oid.Equal(pair.oid) {
			return pair.extKeyUsage, true
		}
	}
	return
}
开发者ID:juanluisvaladas,项目名称:origin,代码行数:8,代码来源:x509.go


示例2: curveOidToString

func curveOidToString(oid asn1.ObjectIdentifier) (t string, bitlen int) {
	switch {
	case oid.Equal(OidNamedCurveP224):
		return "secp224r1", 224
	case oid.Equal(OidNamedCurveP256):
		return "prime256v1", 256
	case oid.Equal(OidNamedCurveP384):
		return "secp384r1", 384
	case oid.Equal(OidNamedCurveP521):
		return "secp521r1", 521
	}
	return fmt.Sprintf("%v", oid), -1
}
开发者ID:jfrazelle,项目名称:cfssl,代码行数:13,代码来源:x509util.go


示例3: namedCurveFromOID

func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve {
	switch {
	case oid.Equal(oidNamedCurveP224):
		return elliptic.P224()
	case oid.Equal(oidNamedCurveP256):
		return elliptic.P256()
	case oid.Equal(oidNamedCurveP384):
		return elliptic.P384()
	case oid.Equal(oidNamedCurveP521):
		return elliptic.P521()
	}
	return nil
}
开发者ID:CadeLaRen,项目名称:docker-3,代码行数:13,代码来源:x509.go


示例4: getPublicKeyAlgorithmFromOID

func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm {
	switch {
	case oid.Equal(oidPublicKeyRSA):
		return RSA
	case oid.Equal(oidPublicKeyDSA):
		return DSA
	case oid.Equal(oidPublicKeyECDSA):
		return ECDSA
	}
	return UnknownPublicKeyAlgorithm
}
开发者ID:juanluisvaladas,项目名称:origin,代码行数:11,代码来源:x509.go


示例5: OidForStandardExtension

// OidForStandardExtension indicates whether oid identifies a standard extension.
// Standard extensions are listed in RFC 5280 (and other RFCs).
func OidForStandardExtension(oid asn1.ObjectIdentifier) bool {
	if oid.Equal(OidExtensionSubjectKeyId) ||
		oid.Equal(OidExtensionKeyUsage) ||
		oid.Equal(OidExtensionExtendedKeyUsage) ||
		oid.Equal(OidExtensionAuthorityKeyId) ||
		oid.Equal(OidExtensionBasicConstraints) ||
		oid.Equal(OidExtensionSubjectAltName) ||
		oid.Equal(OidExtensionCertificatePolicies) ||
		oid.Equal(OidExtensionNameConstraints) ||
		oid.Equal(OidExtensionCRLDistributionPoints) ||
		oid.Equal(OidExtensionIssuerAltName) ||
		oid.Equal(OidExtensionSubjectDirectoryAttributes) ||
		oid.Equal(OidExtensionInhibitAnyPolicy) ||
		oid.Equal(OidExtensionPolicyConstraints) ||
		oid.Equal(OidExtensionPolicyMappings) ||
		oid.Equal(OidExtensionFreshestCRL) ||
		oid.Equal(OidExtensionSubjectInfoAccess) ||
		oid.Equal(OidExtensionAuthorityInfoAccess) ||
		oid.Equal(OidExtensionCTPoison) ||
		oid.Equal(OidExtensionCTSCT) {
		return true
	}
	return false
}
开发者ID:jfrazelle,项目名称:cfssl,代码行数:26,代码来源:x509util.go


示例6: 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()
	}
}
开发者ID:jfrazelle,项目名称:cfssl,代码行数:40,代码来源:x509util.go


示例7: getSignatureAlgorithmFromOID

func getSignatureAlgorithmFromOID(oid asn1.ObjectIdentifier) SignatureAlgorithm {
	switch {
	case oid.Equal(oidSignatureMD2WithRSA):
		return MD2WithRSA
	case oid.Equal(oidSignatureMD5WithRSA):
		return MD5WithRSA
	case oid.Equal(oidSignatureSHA1WithRSA):
		return SHA1WithRSA
	case oid.Equal(oidSignatureSHA256WithRSA):
		return SHA256WithRSA
	case oid.Equal(oidSignatureSHA384WithRSA):
		return SHA384WithRSA
	case oid.Equal(oidSignatureSHA512WithRSA):
		return SHA512WithRSA
	case oid.Equal(oidSignatureDSAWithSHA1):
		return DSAWithSHA1
	case oid.Equal(oidSignatureDSAWithSHA256):
		return DSAWithSHA256
	case oid.Equal(oidSignatureECDSAWithSHA1):
		return ECDSAWithSHA1
	case oid.Equal(oidSignatureECDSAWithSHA256):
		return ECDSAWithSHA256
	case oid.Equal(oidSignatureECDSAWithSHA384):
		return ECDSAWithSHA384
	case oid.Equal(oidSignatureECDSAWithSHA512):
		return ECDSAWithSHA512
	}
	return UnknownSignatureAlgorithm
}
开发者ID:juanluisvaladas,项目名称:origin,代码行数:29,代码来源:x509.go



注:本文中的github.com/google/certificate-transparency/go/asn1.ObjectIdentifier类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang client.New函数代码示例发布时间:2022-05-23
下一篇:
Golang writer.NewSingleReplication函数代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap