Commit e572677e authored by venushka's avatar venushka Committed by akrherz

Handling xmppAddr being a type of ASN1TaggedObject (i.e. DERTaggedObject) as...

Handling xmppAddr being a type of ASN1TaggedObject (i.e. DERTaggedObject) as it fails to cast the xmppAddr to ASN1String to work with CA signed certificates/self-signed certificates generated with OpenSSL.
parent 90637310
......@@ -235,6 +235,15 @@ public class SANCertificateIdentityMapping implements CertificateIdentityMapping
*/
protected String parseOtherNameXmppAddr( ASN1Primitive xmppAddr )
{
// Get the nested object if the value is an ASN1TaggedObject or a sub-type of it
if (ASN1TaggedObject.class.isAssignableFrom(xmppAddr.getClass())) {
ASN1TaggedObject taggedObject = (ASN1TaggedObject) xmppAddr;
ASN1Primitive objectPrimitive = taggedObject.getObject();
if (ASN1String.class.isAssignableFrom(objectPrimitive.getClass())) {
return ((ASN1String) objectPrimitive).getString();
}
}
// RFC 6120 says that this should be a UTF8String. Lets be tolerant and allow all text-based values.
return ( (ASN1String) xmppAddr ).getString();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment