Package kz.greetgo.security.crypto
Class CryptoBuilder
- java.lang.Object
-
- kz.greetgo.security.crypto.CryptoBuilder
-
public class CryptoBuilder extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Cryptobuild(ContentAccess privateKeyAccess, ContentAccess publicKeyAccess)Builds on custom access to keys contentCryptoBuilderKeysInDbinDb(kz.greetgo.db.DbType dbType, kz.greetgo.db.Jdbc jdbc)CryptoBuilderKeysInFilesinFiles(java.io.File privateKeyFile, java.io.File publicKeyFile)Defines crypto source to store keys in files.CryptoBuilderKeysInMongoinMongo(com.mongodb.client.MongoCollection<org.bson.Document> collection)CryptoBuilderKeysInMongoinMongo(com.mongodb.client.MongoCollection<org.bson.Document> privateKey, com.mongodb.client.MongoCollection<org.bson.Document> publicKey)static CryptoBuildernewBuilder()CryptoBuildersetConfig(CryptoSourceConfig cryptoSourceConfig)Defines crypto config, where you can specify using algorithmsCryptoBuildersetKeySize(int keySize)Defines key size
-
-
-
Method Detail
-
newBuilder
public static CryptoBuilder newBuilder()
-
setKeySize
public CryptoBuilder setKeySize(int keySize)
Defines key size- Parameters:
keySize- key size- Returns:
- reference to this
-
inFiles
public CryptoBuilderKeysInFiles inFiles(java.io.File privateKeyFile, java.io.File publicKeyFile)
Defines crypto source to store keys in files. Files automatically randomly generates at first time- Parameters:
privateKeyFile- private key filepublicKeyFile- public key file- Returns:
- reference to this builder
-
setConfig
public CryptoBuilder setConfig(CryptoSourceConfig cryptoSourceConfig)
Defines crypto config, where you can specify using algorithms- Parameters:
cryptoSourceConfig- config for crypto source- Returns:
- reference to this builder
-
build
public Crypto build(ContentAccess privateKeyAccess, ContentAccess publicKeyAccess)
Builds on custom access to keys content- Parameters:
privateKeyAccess- access to private keypublicKeyAccess- access to public key- Returns:
- built object
-
inDb
public CryptoBuilderKeysInDb inDb(kz.greetgo.db.DbType dbType, kz.greetgo.db.Jdbc jdbc)
-
inMongo
public CryptoBuilderKeysInMongo inMongo(com.mongodb.client.MongoCollection<org.bson.Document> collection)
-
inMongo
public CryptoBuilderKeysInMongo inMongo(com.mongodb.client.MongoCollection<org.bson.Document> privateKey, com.mongodb.client.MongoCollection<org.bson.Document> publicKey)
-
-