import { AsymmetricSignatureVerificationDetachedResult, SNRootKeyParams, KeyedDecryptionSplit, KeyedEncryptionSplit, ItemAuthenticatedData, AsymmetricallyEncryptedString, } from '@standardnotes/encryption' import { KeyParamsOrigination, ProtocolVersion } from '@standardnotes/common' import { BackupFile, DecryptedPayloadInterface, EncryptedPayloadInterface, ItemContent, ItemsKeyInterface, RootKeyInterface, KeySystemIdentifier, KeySystemItemsKeyInterface, KeySystemRootKeyInterface, KeySystemRootKeyParamsInterface, PortablePublicKeySet, } from '@standardnotes/models' export interface EncryptionProviderInterface { initialize(): Promise isPasscodeLocked(): Promise encryptSplitSingle(split: KeyedEncryptionSplit): Promise encryptSplit(split: KeyedEncryptionSplit): Promise decryptSplitSingle< C extends ItemContent = ItemContent, P extends DecryptedPayloadInterface = DecryptedPayloadInterface, >( split: KeyedDecryptionSplit, ): Promise

decryptSplit< C extends ItemContent = ItemContent, P extends DecryptedPayloadInterface = DecryptedPayloadInterface, >( split: KeyedDecryptionSplit, ): Promise<(P | EncryptedPayloadInterface)[]> getEmbeddedPayloadAuthenticatedData( payload: EncryptedPayloadInterface, ): D | undefined getKeyEmbeddedKeyParamsFromItemsKey(key: EncryptedPayloadInterface): SNRootKeyParams | undefined supportedVersions(): ProtocolVersion[] isVersionNewerThanLibraryVersion(version: ProtocolVersion): boolean platformSupportsKeyDerivation(keyParams: SNRootKeyParams): boolean getPasswordCreatedDate(): Date | undefined getEncryptionDisplayName(): Promise upgradeAvailable(): Promise createEncryptedBackupFile(): Promise createDecryptedBackupFile(): BackupFile getUserVersion(): ProtocolVersion | undefined hasAccount(): boolean hasPasscode(): boolean removePasscode(): Promise validateAccountPassword(password: string): Promise< | { valid: true artifacts: { rootKey: RootKeyInterface } } | { valid: boolean } > deleteWorkspaceSpecificKeyStateFromDevice(): Promise unwrapRootKey(wrappingKey: RootKeyInterface): Promise computeRootKey(password: string, keyParams: SNRootKeyParams): Promise computeWrappingKey(passcode: string): Promise hasRootKeyEncryptionSource(): boolean createRootKey( identifier: string, password: string, origination: KeyParamsOrigination, version?: ProtocolVersion, ): Promise getRootKeyParams(): SNRootKeyParams | undefined setNewRootKeyWrapper(wrappingKey: RootKeyInterface): Promise createNewItemsKeyWithRollback(): Promise<() => Promise> getSureDefaultItemsKey(): ItemsKeyInterface createRandomizedKeySystemRootKey(dto: { systemIdentifier: KeySystemIdentifier }): KeySystemRootKeyInterface createUserInputtedKeySystemRootKey(dto: { systemIdentifier: KeySystemIdentifier userInputtedPassword: string }): KeySystemRootKeyInterface deriveUserInputtedKeySystemRootKey(dto: { keyParams: KeySystemRootKeyParamsInterface userInputtedPassword: string }): KeySystemRootKeyInterface createKeySystemItemsKey( uuid: string, keySystemIdentifier: KeySystemIdentifier, sharedVaultUuid: string | undefined, rootKeyToken: string, ): KeySystemItemsKeyInterface asymmetricSignatureVerifyDetached( encryptedString: AsymmetricallyEncryptedString, ): AsymmetricSignatureVerificationDetachedResult getSenderPublicKeySetFromAsymmetricallyEncryptedString(string: string): PortablePublicKeySet }