java/src/main/java/com/genexus/security/web/jose/jwt/JWTSigner.java
/**
     * Sign an input string using RSA and return the encrypted bytes
     */
Sign an input string using RSA and return the encrypted bytes
Sign an input string using RSA and return the encrypted bytes
private static byte[] signRs(final Algorithm algorithm, final String msg, final PrivateKey privateKey) throws NoSuchProviderException,
            NoSuchAlgorithmException, InvalidKeyException, SignatureException {
        final byte[] messageBytes = msg.getBytes();
        final Signature signature = Signature.getInstance(algorithm.getValue(), "BC");
        signature.initSign(privateKey);
        signature.update(messageBytes);
        return signature.sign();
    }
private static byte [ ] signRs ( final Algorithm algorithm , final String msg , final PrivateKey privateKey ) throws NoSuchProviderException , NoSuchAlgorithmException , InvalidKeyException , SignatureException { final byte [ ] messageBytes = msg . getBytes ( ) ; final Signature signature = Signature . getInstance ( algorithm . getValue ( ) , "BC" ) ; signature . initSign ( privateKey ) ; signature . update ( messageBytes ) ; return signature . sign ( ) ; }
Sign an input string using RSA and return the encrypted bytes
Sign an input string using RSA and return the encrypted bytes