func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm { switch { case oid.Equal(oidPublicKeyRsa): return RSA case oid.Equal(oidPublicKeyDsa): return DSA } return UnknownPublicKeyAlgorithm }
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 } return UnknownSignatureAlgorithm }