View Javadoc
1   package civitas.crypto.sharedkey;
2   
3   import javax.crypto.SecretKey;
4   
5   import org.springframework.beans.factory.annotation.Autowired;
6   import org.springframework.stereotype.Controller;
7   
8   import civitas.crypto.CryptoBase;
9   
10  @Controller
11  public class GenerateSharedKey {
12  	@Autowired
13  	CryptoBase cryptoBase;
14  
15  	public SharedKey apply(final int keyLength) {
16  		SecretKey k = cryptoBase.getSharedKeyGenerator(keyLength).generateKey();
17  		return new SharedKey(k, "sharedKey-civitas");
18  	}
19  }