thrownewIllegalArgumentException("subjectAltName 'otherName' sequence's second object is expected to be a tagged value of which the tag number is 0. The tag number that was detected: "+tagNo);
}
finalASN1Primitivevalue=taggedValue.getObject();
switch(typeId.getId())
{
caseOTHERNAME_SRV_OID:
returnparseOtherNameDnsSrv(value);
caseOTHERNAME_XMPP_OID:
returnparseOtherNameXmppAddr(value);
default:
Log.debug("Ignoring subjectAltName 'otherName' type-id '{}' that's neither id-on-xmppAddr nor id-on-dnsSRV.",typeId.getId());
returnnull;
}
catch(CertificateParsingExceptione){
Log.error("Error parsing SubjectAltName in certificate: "+certificate.getSubjectDN(),e);
}
returnidentities;
catch(Exceptione)
{
Log.warn("Unable to parse a byte array (of length {}) as a subjectAltName 'otherName'. It is ignored.",item.length,e);
returnnull;
}
}
/**
* Returns the short name of mapping
* Parses a SRVName value as specified by RFC 4985.
*
* @return The short name of the mapping
* This method parses the argument value as a DNS SRV Resource Record. Only when the parsed value refers to an XMPP
* related service, the corresponding DNS domain name is returned (minus the service name).
*
* @param srvName The ASN.1 representation of the srvName value (cannot be null).
* @return an XMPP address value, or null when the record does not relate to XMPP.