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

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

示例1: namedCurveFromOID

func namedCurveFromOID(oid asn1.ObjectIdentifier) *bitelliptic.BitCurve {
    switch {
    case oid.Equal(oidNamedCurveS256):
        return bitelliptic.S256()
    }
    return nil
}

开发者ID:runeaune,项目名称:bitcoin-crypto,代码行数:7,代码来源:x509.go

示例2: getHashForOID

func getHashForOID(oid asn1.ObjectIdentifier) (crypto.Hash, error) {
    switch {
    case oid.Equal(oidDigestAlgorithmSHA1):
        return crypto.SHA1, nil
    }
    return crypto.Hash(0), ErrUnsupportedAlgorithm
}

开发者ID:GauntletWizard,项目名称:vault,代码行数:7,代码来源:pkcs7.go

示例3: 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:ArtemL,项目名称:GCC,代码行数:8,代码来源:x509.go

示例4: getSignatureAlgorithmFromOID

// TODO(agl): this is taken from crypto/x509 and so should probably be exported
// from crypto/x509 or crypto/x509/pkix.
func getSignatureAlgorithmFromOID(oid asn1.ObjectIdentifier) x509.SignatureAlgorithm {
    for _, details := range signatureAlgorithmDetails {
        if oid.Equal(details.oid) {
            return details.algo
        }
    }
    return x509.UnknownSignatureAlgorithm
}

开发者ID:spazbite187,项目名称:snatchtls,代码行数:10,代码来源:ocsp.go

示例5: getPublicKeyAlgorithmFromOID

func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm {
    switch {
    case oid.Equal(oidPublicKeyRsa):
        return RSA
    case oid.Equal(oidPublicKeyDsa):
        return DSA
    }
    return UnknownPublicKeyAlgorithm
}

开发者ID:jmcadden,项目名称:EbbRT-gcc,代码行数:9,代码来源:x509.go

最后编辑: kuteng  文档更新时间: 2021-08-23 19:14   作者:kuteng