code: public byte[] sign(String privateKeyId, byte[] message) {
  		Signer signer = cache.get(privateKeyId);
  
  		if (signer != null) {
  			return signer.sign(message);
  		}
  
  		SignerImpl signerImpl = new SignerImpl();
  		PrivateKey privateKey = privateKeyMap.get(privateKeyId);
  
  		if (privateKey == null) {
  			throw new SignatureException("private key not found: privateKeyId=" + privateKeyId);
  		}
  
  		signerImpl.setPrivateKey(privateKey);
  		signerImpl.setAlgorithm(algorithm);
  		signerImpl.setProvider(provider);
  		cache.put(privateKeyId, signerImpl);
  		return signerImpl.sign(message);
  	}
docs: Signs a message.
  
  @param privateKeyId the logical name of the private key as configured in
  the private key map
  @param message the message to sign
  @return the signature
  @see #setPrivateKeyMap(java.util.Map)