fix: extraction abstract key split

This commit is contained in:
Karol Sójko
2022-07-05 12:38:34 +02:00
parent 03497cbf5b
commit 85ab5b914a
3 changed files with 25 additions and 19 deletions

View File

@@ -0,0 +1,23 @@
import {
DecryptedPayloadInterface,
EncryptedPayloadInterface,
ItemsKeyInterface,
RootKeyInterface,
} from '@standardnotes/models'
export interface AbstractKeySplit<T = EncryptedPayloadInterface | DecryptedPayloadInterface> {
usesRootKey?: {
items: T[]
key: RootKeyInterface
}
usesItemsKey?: {
items: T[]
key: ItemsKeyInterface
}
usesRootKeyWithKeyLookup?: {
items: T[]
}
usesItemsKeyWithKeyLookup?: {
items: T[]
}
}

View File

@@ -2,29 +2,11 @@ import { Uuid } from '@standardnotes/common'
import {
DecryptedPayloadInterface,
EncryptedPayloadInterface,
ItemsKeyInterface,
PayloadInterface,
RootKeyInterface,
} from '@standardnotes/models'
import { AbstractKeySplit } from './AbstractKeySplit'
import { EncryptionTypeSplit } from './EncryptionTypeSplit'
export interface AbstractKeySplit<T = EncryptedPayloadInterface | DecryptedPayloadInterface> {
usesRootKey?: {
items: T[]
key: RootKeyInterface
}
usesItemsKey?: {
items: T[]
key: ItemsKeyInterface
}
usesRootKeyWithKeyLookup?: {
items: T[]
}
usesItemsKeyWithKeyLookup?: {
items: T[]
}
}
export type KeyedEncryptionSplit = AbstractKeySplit<DecryptedPayloadInterface>
export type KeyedDecryptionSplit = AbstractKeySplit<EncryptedPayloadInterface>

View File

@@ -26,6 +26,7 @@ export * from './Service/Functions'
export * from './Service/Items/ItemsEncryption'
export * from './Service/RootKey/KeyMode'
export * from './Service/RootKey/RootKeyEncryption'
export * from './Split/AbstractKeySplit'
export * from './Split/EncryptionSplit'
export * from './Split/EncryptionTypeSplit'
export * from './Split/Functions'