core/src/main/java/org/keycloak/util/CertificateUtils.java
/**
     * Creates the content signer for generation of Version 1 {@link java.security.cert.X509Certificate}.
     *
     * @param privateKey the private key
     *
     * @return the content signer
     */
Creates the content signer for generation of Version 1  java.security.cert.X509Certificate.

@param privateKey the private key

@return the content signer
Creates the content signer for generation of Version 1 java . security . cert . X509Certificate . @param privateKey the private key @return the content signer
public static ContentSigner createSigner(PrivateKey privateKey) {
        try {
            AlgorithmIdentifier sigAlgId = new DefaultSignatureAlgorithmIdentifierFinder().find("SHA256WithRSAEncryption");
            AlgorithmIdentifier digAlgId = new DefaultDigestAlgorithmIdentifierFinder().find(sigAlgId);
            return new BcRSAContentSignerBuilder(sigAlgId, digAlgId)
                    .build(PrivateKeyFactory.createKey(privateKey.getEncoded()));
        } catch (Exception e) {
            throw new RuntimeException("Could not create content signer.", e);
        }
    }
public static ContentSigner createSigner ( PrivateKey privateKey ) { try { AlgorithmIdentifier sigAlgId = new DefaultSignatureAlgorithmIdentifierFinder ( ) . find ( "SHA256WithRSAEncryption" ) ; AlgorithmIdentifier digAlgId = new DefaultDigestAlgorithmIdentifierFinder ( ) . find ( sigAlgId ) ; return new BcRSAContentSignerBuilder ( sigAlgId , digAlgId ) . build ( PrivateKeyFactory . createKey ( privateKey . getEncoded ( ) ) ) ; } catch ( Exception e ) { throw new RuntimeException ( "Could not create content signer." , e ) ; } }
Creates the content signer for generation of Version 1 {@link java.security.cert.X509Certificate}.
Creates the content signer for generation of Version 1 { @link java . security . cert . X509Certificate } .