Esempio n. 1
0
        public SealService()
        {
            SealContext         = SealUtils.GetContext();
            using var keygen    = new KeyGenerator(SealContext);
            using var publicKey = keygen.PublicKey;
            using var secretKey = keygen.SecretKey;

            PublicKeyBase64  = SealUtils.PublicKeyToBase64String(publicKey);
            PrivateKeyBase64 = SealUtils.SecretKeyToBase64String(secretKey);
        }
Esempio n. 2
0
        public Decryptor CreateDecryptor()
        {
            Decryptor decryptor = new Decryptor(SealContext, SealUtils.BuildSecretKeyFromBase64String(PrivateKeyBase64, SealContext));

            return(decryptor);
        }
Esempio n. 3
0
        public Encryptor CreateEncryptor()
        {
            var encryptor = new Encryptor(SealContext, SealUtils.BuildPublicKeyFromBase64String(PublicKeyBase64, SealContext));

            return(encryptor);
        }