code: public byte[] sign(KeyStoreChooser keyStoreChooser, PrivateKeyChooserByAlias privateKeyChooserByAlias, byte[] message) {
  		Signer signer = cache.get(cacheKey(keyStoreChooser, privateKeyChooserByAlias));
  
  		if (signer != null) {
  			return signer.sign(message);
  		}
  
  		SignerImpl signerImpl = new SignerImpl();
  		signerImpl.setAlgorithm(algorithm);
  		signerImpl.setProvider(provider);
  		PrivateKey privateKey = privateKeyRegistryByAlias.get(keyStoreChooser, privateKeyChooserByAlias);
  
  		if (privateKey == null) {
  			throw new SignatureException("private key not found in registry: keyStoreName="
  					+ keyStoreChooser.getKeyStoreName() + ", alias=" + privateKeyChooserByAlias.getAlias());
  		}
  
  		signerImpl.setPrivateKey(privateKey);
  		cache.put(cacheKey(keyStoreChooser, privateKeyChooserByAlias), signerImpl);
  		return signerImpl.sign(message);
  	}
docs: Signs a message.
  
  @param keyStoreChooser the keystore chooser
  @param privateKeyChooserByAlias the private key chooser
  @param message the message to sign
  @return the signature