private static Optional<AthenzIdentity> getRoleIdentityFromUri(List<SubjectAlternativeName> sans) {
        String uriPrefix = "athenz://principal/";
        return sans.stream()
                .filter(s -> s.getType() == Type.URI && s.getValue().startsWith(uriPrefix))
                .map(san -> {
                    String uriPath = URI.create(san.getValue()).getPath();
                    return AthenzIdentities.from(uriPath.substring(uriPrefix.length()));
                })
                .findFirst();
    }
Utility methods for Athenz issued x509 certificates

@author bjorncs
vespa-athenz/src/main/java/com/yahoo/vespa/athenz/tls/AthenzX509CertificateUtils.java