fix: encryption exports (#1205)
* fix: encryptio exports * fix: imports * fix: items key mutator import
This commit is contained in:
@@ -7,17 +7,3 @@ export type BackupFile = {
|
|||||||
auth_params?: AnyKeyParamsContent
|
auth_params?: AnyKeyParamsContent
|
||||||
items: (BackupFileDecryptedContextualPayload | BackupFileEncryptedContextualPayload)[]
|
items: (BackupFileDecryptedContextualPayload | BackupFileEncryptedContextualPayload)[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum BackupFileType {
|
|
||||||
Encrypted = 'Encrypted',
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generated when an export is made from an application with no account and no passcode. The
|
|
||||||
* items are encrypted, but the items keys are not.
|
|
||||||
*/
|
|
||||||
EncryptedWithNonEncryptedItemsKey = 'EncryptedWithNonEncryptedItemsKey',
|
|
||||||
|
|
||||||
FullyDecrypted = 'FullyDecrypted',
|
|
||||||
|
|
||||||
Corrupt = 'Corrupt',
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import {
|
|||||||
leftVersionGreaterThanOrEqualToRight,
|
leftVersionGreaterThanOrEqualToRight,
|
||||||
compareVersions,
|
compareVersions,
|
||||||
} from '@standardnotes/common'
|
} from '@standardnotes/common'
|
||||||
import { BackupFile, BackupFileType } from './BackupFile'
|
import { BackupFile } from './BackupFile'
|
||||||
|
import { BackupFileType } from './BackupFileType'
|
||||||
import { extendArray } from '@standardnotes/utils'
|
import { extendArray } from '@standardnotes/utils'
|
||||||
import { EncryptionService } from '../Service/Encryption/EncryptionService'
|
import { EncryptionService } from '../Service/Encryption/EncryptionService'
|
||||||
import {
|
import {
|
||||||
@@ -28,7 +29,7 @@ import { CreateAnyKeyParams } from '../Keys/RootKey/KeyParamsFunctions'
|
|||||||
import { SNRootKeyParams } from '../Keys/RootKey/RootKeyParams'
|
import { SNRootKeyParams } from '../Keys/RootKey/RootKeyParams'
|
||||||
import { SNRootKey } from '../Keys/RootKey/RootKey'
|
import { SNRootKey } from '../Keys/RootKey/RootKey'
|
||||||
import { ContentTypeUsesRootKeyEncryption } from '../Keys/RootKey/Functions'
|
import { ContentTypeUsesRootKeyEncryption } from '../Keys/RootKey/Functions'
|
||||||
import { isItemsKey, SNItemsKey } from '../Keys/ItemsKey'
|
import { isItemsKey, SNItemsKey } from '../Keys/ItemsKey/ItemsKey'
|
||||||
|
|
||||||
export async function DecryptBackupFile(
|
export async function DecryptBackupFile(
|
||||||
file: BackupFile,
|
file: BackupFile,
|
||||||
|
|||||||
13
packages/encryption/src/Domain/Backups/BackupFileType.ts
Normal file
13
packages/encryption/src/Domain/Backups/BackupFileType.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
export enum BackupFileType {
|
||||||
|
Encrypted = 'Encrypted',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generated when an export is made from an application with no account and no passcode. The
|
||||||
|
* items are encrypted, but the items keys are not.
|
||||||
|
*/
|
||||||
|
EncryptedWithNonEncryptedItemsKey = 'EncryptedWithNonEncryptedItemsKey',
|
||||||
|
|
||||||
|
FullyDecrypted = 'FullyDecrypted',
|
||||||
|
|
||||||
|
Corrupt = 'Corrupt',
|
||||||
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
export * from './ItemsKey'
|
|
||||||
export * from './ItemsKeyMutator'
|
|
||||||
export * from './Registration'
|
|
||||||
@@ -20,7 +20,7 @@ import { DecryptedParameters, EncryptedParameters, ErrorDecryptingParameters } f
|
|||||||
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
||||||
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
||||||
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
||||||
import { isItemsKey } from '../../Keys/ItemsKey'
|
import { isItemsKey } from '../../Keys/ItemsKey/ItemsKey'
|
||||||
import { CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
import { CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
||||||
|
|
||||||
const NO_IV = '00000000000000000000000000000000'
|
const NO_IV = '00000000000000000000000000000000'
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { DecryptedParameters, EncryptedParameters, ErrorDecryptingParameters } f
|
|||||||
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
||||||
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
||||||
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
||||||
import { isItemsKey } from '../../Keys/ItemsKey'
|
import { isItemsKey } from '../../Keys/ItemsKey/ItemsKey'
|
||||||
import { CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
import { CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
||||||
import { ItemContent, PayloadTimestampDefaults } from '@standardnotes/models'
|
import { ItemContent, PayloadTimestampDefaults } from '@standardnotes/models'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ContentType, ProtocolVersion } from '@standardnotes/common'
|
import { ContentType, ProtocolVersion } from '@standardnotes/common'
|
||||||
import { DecryptedPayload, ItemContent, ItemsKeyContent, PayloadTimestampDefaults } from '@standardnotes/models'
|
import { DecryptedPayload, ItemContent, ItemsKeyContent, PayloadTimestampDefaults } from '@standardnotes/models'
|
||||||
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
|
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
|
||||||
import { SNItemsKey } from '../../Keys/ItemsKey'
|
import { SNItemsKey } from '../../Keys/ItemsKey/ItemsKey'
|
||||||
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
||||||
import { SNProtocolOperator004 } from './Operator004'
|
import { SNProtocolOperator004 } from './Operator004'
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { DecryptedParameters, EncryptedParameters, ErrorDecryptingParameters } f
|
|||||||
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
import { RootKeyEncryptedAuthenticatedData } from '../../Types/RootKeyEncryptedAuthenticatedData'
|
||||||
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
import { ItemAuthenticatedData } from '../../Types/ItemAuthenticatedData'
|
||||||
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
import { LegacyAttachedData } from '../../Types/LegacyAttachedData'
|
||||||
import { isItemsKey } from '../../Keys/ItemsKey'
|
import { isItemsKey } from '../../Keys/ItemsKey/ItemsKey'
|
||||||
|
|
||||||
type V004StringComponents = [version: string, nonce: string, ciphertext: string, authenticatedData: string]
|
type V004StringComponents = [version: string, nonce: string, ciphertext: string, authenticatedData: string]
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
export * from './001/Operator001'
|
|
||||||
export * from './002/Operator002'
|
|
||||||
export * from './003/Operator003'
|
|
||||||
export * from './004/Operator004'
|
|
||||||
export * from './Operator'
|
|
||||||
export * from '../Types/EncryptedParameters'
|
|
||||||
export * from '../Types/ItemAuthenticatedData'
|
|
||||||
export * from '../Types/LegacyAttachedData'
|
|
||||||
export * from '../Types/RootKeyEncryptedAuthenticatedData'
|
|
||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
ErrorDecryptingParameters,
|
ErrorDecryptingParameters,
|
||||||
isErrorDecryptingParameters,
|
isErrorDecryptingParameters,
|
||||||
} from '../../Types/EncryptedParameters'
|
} from '../../Types/EncryptedParameters'
|
||||||
import { ItemsKeyMutator } from '../../Keys/ItemsKey'
|
import { ItemsKeyMutator } from '../../Keys/ItemsKey/ItemsKeyMutator'
|
||||||
import { CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
import { CreateNewRootKey } from '../../Keys/RootKey/Functions'
|
||||||
import {
|
import {
|
||||||
DecryptedPayload,
|
DecryptedPayload,
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
export * from '../Backups/BackupFile'
|
|
||||||
export * from './Encryption/EncryptionService'
|
|
||||||
export * from './RootKey/KeyMode'
|
|
||||||
@@ -1,15 +1,37 @@
|
|||||||
export * from './Algorithm'
|
export * from './Backups/BackupFile'
|
||||||
export * from './Split/EncryptionSplit'
|
export * from './Backups/BackupFileDecryptor'
|
||||||
export * from './Split/EncryptionTypeSplit'
|
export * from './Backups/BackupFileType'
|
||||||
export * from './Operator'
|
export * from './Keys/ItemsKey/ItemsKey'
|
||||||
|
export * from './Keys/ItemsKey/ItemsKeyMutator'
|
||||||
|
export * from './Keys/ItemsKey/Registration'
|
||||||
|
export * from './Keys/RootKey/Functions'
|
||||||
export * from './Keys/RootKey/KeyParamsFunctions'
|
export * from './Keys/RootKey/KeyParamsFunctions'
|
||||||
|
export * from './Keys/RootKey/ProtocolVersionForKeyParams'
|
||||||
export * from './Keys/RootKey/RootKey'
|
export * from './Keys/RootKey/RootKey'
|
||||||
export * from './Keys/RootKey/RootKeyParams'
|
export * from './Keys/RootKey/RootKeyParams'
|
||||||
export * from './Keys/RootKey/Functions'
|
export * from './Keys/RootKey/ValidKeyParamsKeys'
|
||||||
export * from './Service'
|
|
||||||
export * from './Service/Encryption/EncryptionProvider'
|
|
||||||
export * from './Split/EncryptionSplit'
|
|
||||||
export * from './Workspace/PrivateWorkspace'
|
|
||||||
export * from './Keys/ItemsKey'
|
|
||||||
export * from './Keys/Utils/DecryptItemsKey'
|
export * from './Keys/Utils/DecryptItemsKey'
|
||||||
export * from './Keys/Utils/KeyRecoveryStrings'
|
export * from './Keys/Utils/KeyRecoveryStrings'
|
||||||
|
export * from './Operator/001/Operator001'
|
||||||
|
export * from './Operator/002/Operator002'
|
||||||
|
export * from './Operator/003/Operator003'
|
||||||
|
export * from './Operator/004/Operator004'
|
||||||
|
export * from './Operator/Functions'
|
||||||
|
export * from './Operator/Operator'
|
||||||
|
export * from './Operator/OperatorManager'
|
||||||
|
export * from './Operator/OperatorWrapper'
|
||||||
|
export * from './Service/Encryption/EncryptionProvider'
|
||||||
|
export * from './Service/Encryption/EncryptionService'
|
||||||
|
export * from './Service/Functions'
|
||||||
|
export * from './Service/Items/ItemsEncryption'
|
||||||
|
export * from './Service/RootKey/KeyMode'
|
||||||
|
export * from './Service/RootKey/RootKeyEncryption'
|
||||||
|
export * from './Split/EncryptionSplit'
|
||||||
|
export * from './Split/EncryptionTypeSplit'
|
||||||
|
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