protected override void SetupVariant(int options)
        {
            _encrypted = options == 1;
            C4EncryptionKey  crypto     = new C4EncryptionKey();
            C4EncryptionKey *encryption = null;

            if (_encrypted)
            {
                WriteLine("        ...encrypted");
                crypto.algorithm = C4EncryptionAlgorithm.AES256;
                for (int i = 0; i < 32; i++)
                {
                    crypto.bytes[i] = 0xcc;
                }

                encryption = &crypto;
            }

            _store = (C4BlobStore *)LiteCoreBridge.Check(err => Native.c4blob_openStore(Path.Combine(
                                                                                            Test.TestDir, $"cbl_blob_test{Path.DirectorySeparatorChar}"), C4DatabaseFlags.Create, encryption, err));
            var bogusKey = _bogusKey;

            for (int i = 0; i < C4BlobKey.Size; i++)
            {
                bogusKey.bytes[i] = 0x55;
            }
        }
示例#2
0
 public static C4BlobStore *c4blob_openStore(string dirPath,
                                             C4DatabaseFlags flags,
                                             C4EncryptionKey *encryptionKey,
                                             C4Error *outError)
 {
     using (var dirPath_ = new C4String(dirPath)) {
         return(NativeRaw.c4blob_openStore(dirPath_.AsC4Slice(), flags, encryptionKey, outError));
     }
 }
示例#3
0
 public static extern bool c4db_rekey(C4Database *database, C4EncryptionKey *newKey, C4Error *outError);
 public static extern C4BlobStore *c4blob_openStore(C4Slice dirPath, C4DatabaseFlags flags, C4EncryptionKey *encryptionKey, C4Error *outError);
 public void Rekey(C4EncryptionKey *newKey)
 {
     LiteCoreBridge.Check(err => Native.c4db_rekey(_native, newKey, err));
 }
 public bool c4db_rekey(C4Database *database, C4EncryptionKey *newKey, C4Error *outError) => Native.c4db_rekey(database, newKey, outError);
 public C4BlobStore *c4blob_openStore(string dirPath, C4DatabaseFlags flags, C4EncryptionKey *encryptionKey, C4Error *outError) => Native.c4blob_openStore(dirPath, flags, encryptionKey, outError);
 public static C4BlobStore *c4blob_openStore(FLSlice dirPath, C4DatabaseFlags flags, C4EncryptionKey *encryptionKey, C4Error *outError) => Impl.c4blob_openStore(dirPath, flags, encryptionKey, outError);
 public static extern bool c4view_rekey(C4View *view, C4EncryptionKey *newKey, C4Error *outError);