chore(encryption): lint
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { BackupFileDecryptedContextualPayload, BackupFileEncryptedContextualPayload } from '@standardnotes/models'
|
||||
import { AnyKeyParamsContent, ProtocolVersion } from '@standardnotes/common'
|
||||
import { BackupFileDecryptedContextualPayload, BackupFileEncryptedContextualPayload } from '@standardnotes/models'
|
||||
|
||||
export type BackupFile = {
|
||||
version?: ProtocolVersion
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
import {
|
||||
AnyKeyParamsContent,
|
||||
ContentType,
|
||||
ProtocolVersion,
|
||||
leftVersionGreaterThanOrEqualToRight,
|
||||
compareVersions,
|
||||
ContentType,
|
||||
leftVersionGreaterThanOrEqualToRight,
|
||||
ProtocolVersion,
|
||||
} from '@standardnotes/common'
|
||||
import { BackupFile } from './BackupFile'
|
||||
import { BackupFileType } from './BackupFileType'
|
||||
import { extendArray } from '@standardnotes/utils'
|
||||
import { EncryptionService } from '../Service/Encryption/EncryptionService'
|
||||
import {
|
||||
PayloadInterface,
|
||||
DecryptedPayloadInterface,
|
||||
ItemsKeyContent,
|
||||
EncryptedPayloadInterface,
|
||||
isEncryptedPayload,
|
||||
isDecryptedPayload,
|
||||
isEncryptedTransferPayload,
|
||||
EncryptedPayload,
|
||||
DecryptedPayload,
|
||||
isDecryptedTransferPayload,
|
||||
CreateDecryptedItemFromPayload,
|
||||
ItemsKeyInterface,
|
||||
CreatePayloadSplit,
|
||||
DecryptedPayload,
|
||||
DecryptedPayloadInterface,
|
||||
EncryptedPayload,
|
||||
EncryptedPayloadInterface,
|
||||
isDecryptedPayload,
|
||||
isDecryptedTransferPayload,
|
||||
isEncryptedPayload,
|
||||
isEncryptedTransferPayload,
|
||||
ItemsKeyContent,
|
||||
ItemsKeyInterface,
|
||||
PayloadInterface,
|
||||
} from '@standardnotes/models'
|
||||
import { ClientDisplayableError } from '@standardnotes/responses'
|
||||
import { CreateAnyKeyParams } from '../Keys/RootKey/KeyParamsFunctions'
|
||||
import { SNRootKeyParams } from '../Keys/RootKey/RootKeyParams'
|
||||
import { SNRootKey } from '../Keys/RootKey/RootKey'
|
||||
import { ContentTypeUsesRootKeyEncryption } from '../Keys/RootKey/Functions'
|
||||
import { extendArray } from '@standardnotes/utils'
|
||||
import { isItemsKey, SNItemsKey } from '../Keys/ItemsKey/ItemsKey'
|
||||
import { ContentTypeUsesRootKeyEncryption } from '../Keys/RootKey/Functions'
|
||||
import { CreateAnyKeyParams } from '../Keys/RootKey/KeyParamsFunctions'
|
||||
import { SNRootKey } from '../Keys/RootKey/RootKey'
|
||||
import { SNRootKeyParams } from '../Keys/RootKey/RootKeyParams'
|
||||
import { EncryptionService } from '../Service/Encryption/EncryptionService'
|
||||
import { BackupFile } from './BackupFile'
|
||||
import { BackupFileType } from './BackupFileType'
|
||||
|
||||
export async function DecryptBackupFile(
|
||||
file: BackupFile,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { ContentType, ProtocolVersion } from '@standardnotes/common'
|
||||
import {
|
||||
ConflictStrategy,
|
||||
ItemsKeyContent,
|
||||
DecryptedItem,
|
||||
DecryptedPayloadInterface,
|
||||
DecryptedItemInterface,
|
||||
DecryptedPayloadInterface,
|
||||
HistoryEntryInterface,
|
||||
ItemsKeyContent,
|
||||
ItemsKeyInterface,
|
||||
RootKeyInterface,
|
||||
} from '@standardnotes/models'
|
||||
import { ContentType, ProtocolVersion } from '@standardnotes/common'
|
||||
|
||||
export function isItemsKey(x: ItemsKeyInterface | RootKeyInterface): x is ItemsKeyInterface {
|
||||
return x.content_type === ContentType.ItemsKey
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DecryptedItemMutator, ItemsKeyMutatorInterface, ItemsKeyContent } from '@standardnotes/models'
|
||||
import { DecryptedItemMutator, ItemsKeyContent, ItemsKeyMutatorInterface } from '@standardnotes/models'
|
||||
|
||||
export class ItemsKeyMutator extends DecryptedItemMutator<ItemsKeyContent> implements ItemsKeyMutatorInterface {
|
||||
set isDefault(isDefault: boolean) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ContentType } from '@standardnotes/common'
|
||||
import { RegisterItemClass, DecryptedItemMutator, ItemsKeyContent } from '@standardnotes/models'
|
||||
import { DecryptedItemMutator, ItemsKeyContent, RegisterItemClass } from '@standardnotes/models'
|
||||
import { SNItemsKey } from './ItemsKey'
|
||||
import { ItemsKeyMutator } from './ItemsKeyMutator'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SNRootKey } from './RootKey'
|
||||
import { ContentType, ProtocolVersion } from '@standardnotes/common'
|
||||
import {
|
||||
DecryptedPayload,
|
||||
FillItemContentSpecialized,
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
RootKeyContentSpecialized,
|
||||
} from '@standardnotes/models'
|
||||
import { UuidGenerator } from '@standardnotes/utils'
|
||||
import { ContentType, ProtocolVersion } from '@standardnotes/common'
|
||||
import { SNRootKey } from './RootKey'
|
||||
|
||||
export function CreateNewRootKey(content: RootKeyContentSpecialized): SNRootKey {
|
||||
const uuid = UuidGenerator.GenerateUuid()
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { KeyParamsResponse } from '@standardnotes/responses'
|
||||
import {
|
||||
AnyKeyParamsContent,
|
||||
KeyParamsContent001,
|
||||
KeyParamsContent002,
|
||||
KeyParamsContent003,
|
||||
KeyParamsContent004,
|
||||
AnyKeyParamsContent,
|
||||
} from '@standardnotes/common'
|
||||
import { SNRootKeyParams } from './RootKeyParams'
|
||||
import { KeyParamsResponse } from '@standardnotes/responses'
|
||||
import { ProtocolVersionForKeyParams } from './ProtocolVersionForKeyParams'
|
||||
import { SNRootKeyParams } from './RootKeyParams'
|
||||
|
||||
/**
|
||||
* 001, 002:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { V001Algorithm, V002Algorithm } from '../../Algorithm'
|
||||
import { KeyParamsData } from '@standardnotes/responses'
|
||||
import { AnyKeyParamsContent, ProtocolVersion } from '@standardnotes/common'
|
||||
import { KeyParamsData } from '@standardnotes/responses'
|
||||
import { V001Algorithm, V002Algorithm } from '../../Algorithm'
|
||||
|
||||
export function ProtocolVersionForKeyParams(response: KeyParamsData | AnyKeyParamsContent): ProtocolVersion {
|
||||
if (response.version) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { SNRootKeyParams } from './RootKeyParams'
|
||||
import { ProtocolVersion } from '@standardnotes/common'
|
||||
import {
|
||||
RootKeyInterface,
|
||||
RootKeyContent,
|
||||
DecryptedItem,
|
||||
DecryptedPayloadInterface,
|
||||
RootKeyContentInStorage,
|
||||
NamespacedRootKeyInKeychain,
|
||||
RootKeyContent,
|
||||
RootKeyContentInStorage,
|
||||
RootKeyInterface,
|
||||
} from '@standardnotes/models'
|
||||
import { ProtocolVersion } from '@standardnotes/common'
|
||||
import { timingSafeEqual } from '@standardnotes/sncrypto-common'
|
||||
import { SNRootKeyParams } from './RootKeyParams'
|
||||
|
||||
/**
|
||||
* A root key is a local only construct that houses the key used for the encryption
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import {
|
||||
AnyKeyParamsContent,
|
||||
KeyParamsContent001,
|
||||
KeyParamsContent002,
|
||||
KeyParamsContent003,
|
||||
KeyParamsContent004,
|
||||
AnyKeyParamsContent,
|
||||
ProtocolVersion,
|
||||
KeyParamsOrigination,
|
||||
ProtocolVersion,
|
||||
} from '@standardnotes/common'
|
||||
import { RootKeyParamsInterface } from '@standardnotes/models'
|
||||
import { pickByCopy } from '@standardnotes/utils'
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
import { ContentType, KeyParamsOrigination, ProtocolVersion, ProtocolVersionLength } from '@standardnotes/common'
|
||||
import { Create001KeyParams } from '../../Keys/RootKey/KeyParamsFunctions'
|
||||
import { firstHalfOfString, secondHalfOfString, splitString, UuidGenerator } from '@standardnotes/utils'
|
||||
import { AsynchronousOperator } from '../Operator'
|
||||
import {
|
||||
CreateDecryptedItemFromPayload,
|
||||
ItemsKeyContent,
|
||||
ItemsKeyInterface,
|
||||
FillItemContent,
|
||||
ItemContent,
|
||||
DecryptedPayload,
|
||||
DecryptedPayloadInterface,
|
||||
FillItemContent,
|
||||
ItemContent,
|
||||
ItemsKeyContent,
|
||||
ItemsKeyInterface,
|
||||
PayloadTimestampDefaults,
|
||||
} from '@standardnotes/models'
|
||||
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
|
||||
import { SNRootKey } from '../../Keys/RootKey/RootKey'
|
||||
import { SNRootKeyParams } from '../../Keys/RootKey/RootKeyParams'
|
||||
import { firstHalfOfString, secondHalfOfString, splitString, UuidGenerator } from '@standardnotes/utils'
|
||||
import { V001Algorithm } from '../../Algorithm'
|
||||
import { DecryptedParameters, EncryptedParameters, ErrorDecryptingParameters } from '../../Types/EncryptedParameters'
|
||||
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
||||
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
||||
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
||||
import { isItemsKey } from '../../Keys/ItemsKey/ItemsKey'
|
||||
import { CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
||||
import { Create001KeyParams } from '../../Keys/RootKey/KeyParamsFunctions'
|
||||
import { SNRootKey } from '../../Keys/RootKey/RootKey'
|
||||
import { SNRootKeyParams } from '../../Keys/RootKey/RootKeyParams'
|
||||
import { DecryptedParameters, EncryptedParameters, ErrorDecryptingParameters } from '../../Types/EncryptedParameters'
|
||||
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
||||
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
||||
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
||||
import { AsynchronousOperator } from '../Operator'
|
||||
|
||||
const NO_IV = '00000000000000000000000000000000'
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import { Create002KeyParams } from '../../Keys/RootKey/KeyParamsFunctions'
|
||||
import { SNProtocolOperator001 } from '../001/Operator001'
|
||||
import { SNRootKey } from '../../Keys/RootKey/RootKey'
|
||||
import { SNRootKeyParams } from '../../Keys/RootKey/RootKeyParams'
|
||||
import { UuidGenerator } from '@standardnotes/utils'
|
||||
import { V002Algorithm } from '../../Algorithm'
|
||||
import * as Common from '@standardnotes/common'
|
||||
import * as Models from '@standardnotes/models'
|
||||
import { ItemContent, PayloadTimestampDefaults } from '@standardnotes/models'
|
||||
import * as Utils from '@standardnotes/utils'
|
||||
import { DecryptedParameters, EncryptedParameters, ErrorDecryptingParameters } from '../../Types/EncryptedParameters'
|
||||
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
||||
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
||||
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
||||
import { UuidGenerator } from '@standardnotes/utils'
|
||||
import { V002Algorithm } from '../../Algorithm'
|
||||
import { isItemsKey } from '../../Keys/ItemsKey/ItemsKey'
|
||||
import { CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
||||
import { ItemContent, PayloadTimestampDefaults } from '@standardnotes/models'
|
||||
import { Create002KeyParams } from '../../Keys/RootKey/KeyParamsFunctions'
|
||||
import { SNRootKey } from '../../Keys/RootKey/RootKey'
|
||||
import { SNRootKeyParams } from '../../Keys/RootKey/RootKeyParams'
|
||||
import { DecryptedParameters, EncryptedParameters, ErrorDecryptingParameters } from '../../Types/EncryptedParameters'
|
||||
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
||||
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
||||
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
||||
import { SNProtocolOperator001 } from '../001/Operator001'
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import { splitString, UuidGenerator } from '@standardnotes/utils'
|
||||
import { ContentType, KeyParamsOrigination, ProtocolVersion } from '@standardnotes/common'
|
||||
import {
|
||||
CreateDecryptedItemFromPayload,
|
||||
DecryptedPayload,
|
||||
FillItemContent,
|
||||
ItemsKeyContent,
|
||||
ItemsKeyInterface,
|
||||
FillItemContent,
|
||||
PayloadTimestampDefaults,
|
||||
} from '@standardnotes/models'
|
||||
import { SNRootKey } from '../../Keys/RootKey/RootKey'
|
||||
import { splitString, UuidGenerator } from '@standardnotes/utils'
|
||||
import { V003Algorithm } from '../../Algorithm'
|
||||
import { Create003KeyParams } from '../../Keys/RootKey/KeyParamsFunctions'
|
||||
import { SNProtocolOperator002 } from '../002/Operator002'
|
||||
import { ContentType, KeyParamsOrigination, ProtocolVersion } from '@standardnotes/common'
|
||||
import { SNRootKeyParams } from '../../Keys/RootKey/RootKeyParams'
|
||||
import { CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
||||
import { Create003KeyParams } from '../../Keys/RootKey/KeyParamsFunctions'
|
||||
import { SNRootKey } from '../../Keys/RootKey/RootKey'
|
||||
import { SNRootKeyParams } from '../../Keys/RootKey/RootKeyParams'
|
||||
import { SNProtocolOperator002 } from '../002/Operator002'
|
||||
|
||||
/**
|
||||
* @legacy
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { ContentType, KeyParamsOrigination, ProtocolVersion } from '@standardnotes/common'
|
||||
import { Create004KeyParams } from '../../Keys/RootKey/KeyParamsFunctions'
|
||||
import { SynchronousOperator } from '../Operator'
|
||||
import * as Models from '@standardnotes/models'
|
||||
import {
|
||||
CreateDecryptedItemFromPayload,
|
||||
FillItemContent,
|
||||
@@ -10,17 +9,18 @@ import {
|
||||
PayloadTimestampDefaults,
|
||||
} from '@standardnotes/models'
|
||||
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
|
||||
import * as Utils from '@standardnotes/utils'
|
||||
import { V004Algorithm } from '../../Algorithm'
|
||||
import { isItemsKey } from '../../Keys/ItemsKey/ItemsKey'
|
||||
import { ContentTypeUsesRootKeyEncryption, CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
||||
import { Create004KeyParams } from '../../Keys/RootKey/KeyParamsFunctions'
|
||||
import { SNRootKey } from '../../Keys/RootKey/RootKey'
|
||||
import { SNRootKeyParams } from '../../Keys/RootKey/RootKeyParams'
|
||||
import { V004Algorithm } from '../../Algorithm'
|
||||
import * as Models from '@standardnotes/models'
|
||||
import * as Utils from '@standardnotes/utils'
|
||||
import { ContentTypeUsesRootKeyEncryption, CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
||||
import { DecryptedParameters, EncryptedParameters, ErrorDecryptingParameters } from '../../Types/EncryptedParameters'
|
||||
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
||||
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
||||
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
||||
import { isItemsKey } from '../../Keys/ItemsKey/ItemsKey'
|
||||
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
||||
import { SynchronousOperator } from '../Operator'
|
||||
|
||||
type V004StringComponents = [version: string, nonce: string, ciphertext: string, authenticatedData: string]
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ProtocolVersion } from '@standardnotes/common'
|
||||
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
|
||||
import { SNProtocolOperator001 } from '../Operator/001/Operator001'
|
||||
import { SNProtocolOperator002 } from '../Operator/002/Operator002'
|
||||
import { SNProtocolOperator003 } from '../Operator/003/Operator003'
|
||||
import { SNProtocolOperator004 } from '../Operator/004/Operator004'
|
||||
import { AsynchronousOperator, SynchronousOperator } from '../Operator/Operator'
|
||||
import { ProtocolVersion } from '@standardnotes/common'
|
||||
|
||||
export function createOperatorForVersion(
|
||||
version: ProtocolVersion,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { ItemsKeyInterface, RootKeyInterface } from '@standardnotes/models'
|
||||
import { KeyParamsOrigination } from '@standardnotes/common'
|
||||
import * as Models from '@standardnotes/models'
|
||||
import { ItemsKeyInterface, RootKeyInterface } from '@standardnotes/models'
|
||||
import { SNRootKey } from '../Keys/RootKey/RootKey'
|
||||
import { SNRootKeyParams } from '../Keys/RootKey/RootKeyParams'
|
||||
import { KeyParamsOrigination } from '@standardnotes/common'
|
||||
import { DecryptedParameters, EncryptedParameters, ErrorDecryptingParameters } from '../Types/EncryptedParameters'
|
||||
import { RootKeyEncryptedAuthenticatedData } from '../Types/RootKeyEncryptedAuthenticatedData'
|
||||
import { ItemAuthenticatedData } from '../Types/ItemAuthenticatedData'
|
||||
import { LegacyAttachedData } from '../Types/LegacyAttachedData'
|
||||
import { RootKeyEncryptedAuthenticatedData } from '../Types/RootKeyEncryptedAuthenticatedData'
|
||||
|
||||
/**w
|
||||
* An operator is responsible for performing crypto operations, such as generating keys
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
|
||||
import { ProtocolVersion, ProtocolVersionLatest } from '@standardnotes/common'
|
||||
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
|
||||
import { createOperatorForVersion } from './Functions'
|
||||
import { AsynchronousOperator, SynchronousOperator } from './Operator'
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { isAsyncOperator } from './Functions'
|
||||
import { OperatorManager } from './OperatorManager'
|
||||
import * as Models from '@standardnotes/models'
|
||||
import {
|
||||
DecryptedParameters,
|
||||
@@ -7,6 +5,8 @@ import {
|
||||
encryptedParametersFromPayload,
|
||||
ErrorDecryptingParameters,
|
||||
} from '../Types/EncryptedParameters'
|
||||
import { isAsyncOperator } from './Functions'
|
||||
import { OperatorManager } from './OperatorManager'
|
||||
|
||||
export async function encryptPayload(
|
||||
payload: Models.DecryptedPayloadInterface,
|
||||
|
||||
@@ -1,35 +1,5 @@
|
||||
import { BackupFile } from '../../Backups/BackupFile'
|
||||
import { CreateAnyKeyParams } from '../../Keys/RootKey/KeyParamsFunctions'
|
||||
import { DecryptBackupFile } from '../../Backups/BackupFileDecryptor'
|
||||
import { EncryptionProvider } from './EncryptionProvider'
|
||||
import { findDefaultItemsKey } from '../Functions'
|
||||
import { ItemsEncryptionService } from '../Items/ItemsEncryption'
|
||||
import { KeyMode } from '../RootKey/KeyMode'
|
||||
import { OperatorManager } from '../../Operator/OperatorManager'
|
||||
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
|
||||
import { SNRootKey } from '../../Keys/RootKey/RootKey'
|
||||
import { SNRootKeyParams } from '../../Keys/RootKey/RootKeyParams'
|
||||
import { V001Algorithm, V002Algorithm } from '../../Algorithm'
|
||||
import * as Common from '@standardnotes/common'
|
||||
import {
|
||||
CreateEncryptionSplitWithKeyLookup,
|
||||
FindPayloadInDecryptionSplit,
|
||||
FindPayloadInEncryptionSplit,
|
||||
} from '../../Split/EncryptionSplit'
|
||||
import * as Models from '@standardnotes/models'
|
||||
import * as RootKeyEncryption from '../RootKey/RootKeyEncryption'
|
||||
import * as Services from '@standardnotes/services'
|
||||
import * as Utils from '@standardnotes/utils'
|
||||
import {
|
||||
DecryptedParameters,
|
||||
EncryptedParameters,
|
||||
ErrorDecryptingParameters,
|
||||
isErrorDecryptingParameters,
|
||||
encryptedParametersFromPayload,
|
||||
} from '../../Types/EncryptedParameters'
|
||||
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
||||
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
||||
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
||||
import {
|
||||
CreateDecryptedBackupFileContextPayload,
|
||||
CreateEncryptedBackupFileContextPayload,
|
||||
@@ -38,12 +8,42 @@ import {
|
||||
isEncryptedPayload,
|
||||
RootKeyInterface,
|
||||
} from '@standardnotes/models'
|
||||
import { SplitPayloadsByEncryptionType } from '../../Split/Functions'
|
||||
import { ClientDisplayableError } from '@standardnotes/responses'
|
||||
import { isNotUndefined } from '@standardnotes/utils'
|
||||
import * as Services from '@standardnotes/services'
|
||||
import { DiagnosticInfo } from '@standardnotes/services'
|
||||
import { KeyedEncryptionSplit } from '../../Split/KeyedEncryptionSplit'
|
||||
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
|
||||
import * as Utils from '@standardnotes/utils'
|
||||
import { isNotUndefined } from '@standardnotes/utils'
|
||||
import { V001Algorithm, V002Algorithm } from '../../Algorithm'
|
||||
import { BackupFile } from '../../Backups/BackupFile'
|
||||
import { DecryptBackupFile } from '../../Backups/BackupFileDecryptor'
|
||||
import { CreateAnyKeyParams } from '../../Keys/RootKey/KeyParamsFunctions'
|
||||
import { SNRootKey } from '../../Keys/RootKey/RootKey'
|
||||
import { SNRootKeyParams } from '../../Keys/RootKey/RootKeyParams'
|
||||
import { OperatorManager } from '../../Operator/OperatorManager'
|
||||
import {
|
||||
CreateEncryptionSplitWithKeyLookup,
|
||||
FindPayloadInDecryptionSplit,
|
||||
FindPayloadInEncryptionSplit,
|
||||
} from '../../Split/EncryptionSplit'
|
||||
import { SplitPayloadsByEncryptionType } from '../../Split/Functions'
|
||||
import { KeyedDecryptionSplit } from '../../Split/KeyedDecryptionSplit'
|
||||
import { KeyedEncryptionSplit } from '../../Split/KeyedEncryptionSplit'
|
||||
import {
|
||||
DecryptedParameters,
|
||||
EncryptedParameters,
|
||||
encryptedParametersFromPayload,
|
||||
ErrorDecryptingParameters,
|
||||
isErrorDecryptingParameters,
|
||||
} from '../../Types/EncryptedParameters'
|
||||
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
||||
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
||||
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
||||
import { findDefaultItemsKey } from '../Functions'
|
||||
import { ItemsEncryptionService } from '../Items/ItemsEncryption'
|
||||
import { KeyMode } from '../RootKey/KeyMode'
|
||||
import * as RootKeyEncryption from '../RootKey/RootKeyEncryption'
|
||||
import { EncryptionProvider } from './EncryptionProvider'
|
||||
|
||||
export enum EncryptionServiceEvent {
|
||||
RootKeyStatusChanged = 'RootKeyStatusChanged',
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import { ContentType, ProtocolVersion } from '@standardnotes/common'
|
||||
import { findDefaultItemsKey } from '../Functions'
|
||||
import { OperatorManager } from '../../Operator/OperatorManager'
|
||||
import { StandardException } from '../../StandardException'
|
||||
import * as OperatorWrapper from '../../Operator/OperatorWrapper'
|
||||
import * as Models from '@standardnotes/models'
|
||||
import { isEncryptedPayload } from '@standardnotes/models'
|
||||
import * as Services from '@standardnotes/services'
|
||||
import { DiagnosticInfo } from '@standardnotes/services'
|
||||
import { Uuids } from '@standardnotes/utils'
|
||||
import { OperatorManager } from '../../Operator/OperatorManager'
|
||||
import * as OperatorWrapper from '../../Operator/OperatorWrapper'
|
||||
import { StandardException } from '../../StandardException'
|
||||
import {
|
||||
DecryptedParameters,
|
||||
EncryptedParameters,
|
||||
ErrorDecryptingParameters,
|
||||
isErrorDecryptingParameters,
|
||||
} from '../../Types/EncryptedParameters'
|
||||
import { isEncryptedPayload } from '@standardnotes/models'
|
||||
import { DiagnosticInfo } from '@standardnotes/services'
|
||||
import { Uuids } from '@standardnotes/utils'
|
||||
import { findDefaultItemsKey } from '../Functions'
|
||||
|
||||
export class ItemsEncryptionService extends Services.AbstractService {
|
||||
private removeItemsObserver!: () => void
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
import { CreateAnyKeyParams } from '../../Keys/RootKey/KeyParamsFunctions'
|
||||
import { findDefaultItemsKey } from '../Functions'
|
||||
import { KeyMode } from './KeyMode'
|
||||
import { OperatorManager } from '../../Operator/OperatorManager'
|
||||
import { SNRootKey } from '../../Keys/RootKey/RootKey'
|
||||
import { SNRootKeyParams } from '../../Keys/RootKey/RootKeyParams'
|
||||
import { UuidGenerator } from '@standardnotes/utils'
|
||||
import * as Common from '@standardnotes/common'
|
||||
import * as Models from '@standardnotes/models'
|
||||
import * as OperatorWrapper from '../../Operator/OperatorWrapper'
|
||||
import {
|
||||
DecryptedPayload,
|
||||
FillItemContentSpecialized,
|
||||
ItemsKeyContent,
|
||||
ItemsKeyContentSpecialized,
|
||||
NamespacedRootKeyInKeychain,
|
||||
PayloadTimestampDefaults,
|
||||
RootKeyContent,
|
||||
RootKeyInterface,
|
||||
} from '@standardnotes/models'
|
||||
import * as Services from '@standardnotes/services'
|
||||
import { UuidGenerator } from '@standardnotes/utils'
|
||||
import { ItemsKeyMutator } from '../../Keys/ItemsKey/ItemsKeyMutator'
|
||||
import { CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
||||
import { CreateAnyKeyParams } from '../../Keys/RootKey/KeyParamsFunctions'
|
||||
import { SNRootKey } from '../../Keys/RootKey/RootKey'
|
||||
import { SNRootKeyParams } from '../../Keys/RootKey/RootKeyParams'
|
||||
import { OperatorManager } from '../../Operator/OperatorManager'
|
||||
import * as OperatorWrapper from '../../Operator/OperatorWrapper'
|
||||
import {
|
||||
DecryptedParameters,
|
||||
EncryptedParameters,
|
||||
ErrorDecryptingParameters,
|
||||
isErrorDecryptingParameters,
|
||||
} from '../../Types/EncryptedParameters'
|
||||
import { ItemsKeyMutator } from '../../Keys/ItemsKey/ItemsKeyMutator'
|
||||
import { CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
||||
import {
|
||||
DecryptedPayload,
|
||||
FillItemContentSpecialized,
|
||||
ItemsKeyContent,
|
||||
ItemsKeyContentSpecialized,
|
||||
PayloadTimestampDefaults,
|
||||
RootKeyContent,
|
||||
RootKeyInterface,
|
||||
NamespacedRootKeyInKeychain,
|
||||
} from '@standardnotes/models'
|
||||
import { findDefaultItemsKey } from '../Functions'
|
||||
import { KeyMode } from './KeyMode'
|
||||
|
||||
export enum RootKeyServiceEvent {
|
||||
RootKeyStatusChanged = 'RootKeyStatusChanged',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Uuid, ProtocolVersion } from '@standardnotes/common'
|
||||
import { ProtocolVersion, Uuid } from '@standardnotes/common'
|
||||
|
||||
export type ItemAuthenticatedData = {
|
||||
u: Uuid
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from './Algorithm'
|
||||
export * from './Backups/BackupFile'
|
||||
export * from './Backups/BackupFileDecryptor'
|
||||
export * from './Backups/BackupFileType'
|
||||
@@ -32,10 +33,9 @@ export * from './Split/EncryptionTypeSplit'
|
||||
export * from './Split/Functions'
|
||||
export * from './Split/KeyedDecryptionSplit'
|
||||
export * from './Split/KeyedEncryptionSplit'
|
||||
export * from './StandardException'
|
||||
export * from './Types/EncryptedParameters'
|
||||
export * from './Types/ItemAuthenticatedData'
|
||||
export * from './Types/LegacyAttachedData'
|
||||
export * from './Types/RootKeyEncryptedAuthenticatedData'
|
||||
export * from './Workspace/PrivateWorkspace'
|
||||
export * from './Algorithm'
|
||||
export * from './StandardException'
|
||||
|
||||
Reference in New Issue
Block a user