public static URIName nameConstraint ( DerValue value ) throws IOException { URI uri ; String name = value . getIA5String ( ) ; try { uri = new URI ( name ) ; } catch ( URISyntaxException use ) { throw new IOException ( "invalid URI name constraint:" + name , use ) ; } if ( uri . getScheme ( ) == null ) { String host = uri . getSchemeSpecificPart ( ) ; try { DNSName hostDNS ; if ( host . charAt ( 0 ) == ' ' ) { hostDNS = new DNSName ( host . substring ( 1 ) ) ; } else { hostDNS = new DNSName ( host ) ; } return new URIName ( uri , host , hostDNS ) ; } catch ( IOException ioe ) { throw new IOException ( "invalid URI name constraint:" + name , ioe ) ; } } else { throw new IOException ( "invalid URI name constraint (should not " + "include scheme):" + name ) ; } }
Create the URIName object with the specified name constraint . URI name constraints syntax is different than SubjectAltNames etc . See 4 . 2 . 1 . 11 of RFC 3280 .