code: public String sign(String privateKeyId, String message) {
  		Base64EncodedSigner signer = cache.get(privateKeyId);
  
  		if (signer != null) {
  			return signer.sign(message);
  		}
  
  		Base64EncodedSignerImpl signerImpl = new Base64EncodedSignerImpl();
  		signerImpl.setAlgorithm(algorithm);
  		signerImpl.setCharsetName(charsetName);
  		signerImpl.setProvider(provider);
  		PrivateKey privateKey = privateKeyMap.get(privateKeyId);
  
  		if (privateKey == null) {
  			throw new SignatureException("private key not found: privateKeyId=" + privateKeyId);
  		}
  
  		signerImpl.setPrivateKey(privateKey);
  		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 underlying mapping
  @param message the message to sign
  @return a base64 encoded version of the signature
  @see #setPrivateKeyMap(java.util.Map)