public static PublicKey readPublicKey(String pemResName) throws Exception {
        InputStream contentIS = TokenUtils.class.getResourceAsStream(pemResName);
        byte[] tmp = new byte[4096];
        int length = contentIS.read(tmp);
        PublicKey publicKey = decodePublicKey(new String(tmp, 0, length));
        return publicKey;
    }
public static PublicKey readPublicKey ( String pemResName ) throws Exception { InputStream contentIS = TokenUtils . class . getResourceAsStream ( pemResName ) ; byte [ ] tmp = new byte [ 4096 ] ; int length = contentIS . read ( tmp ) ; PublicKey publicKey = decodePublicKey ( new String ( tmp , 0 , length ) ) ; return publicKey ; }
Read a PEM encoded public key from the classpath

@param pemResName - key file resource name
@return PublicKey
@throws Exception on decode failure