Class CryptoBuilder

java.lang.Object
kz.greetgo.security.crypto.CryptoBuilder

public class CryptoBuilder
extends java.lang.Object
  • Method Details

    • 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 file
      publicKeyFile - 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 key
      publicKeyAccess - 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)