pub struct CipherView {Show 31 fields
pub id: Option<CipherId>,
pub organization_id: Option<OrganizationId>,
pub folder_id: Option<FolderId>,
pub collection_ids: Vec<CollectionId>,
pub key: Option<EncString>,
pub name: String,
pub notes: Option<String>,
pub type: CipherType,
pub login: Option<LoginView>,
pub identity: Option<IdentityView>,
pub card: Option<CardView>,
pub secure_note: Option<SecureNoteView>,
pub ssh_key: Option<SshKeyView>,
pub bank_account: Option<BankAccountView>,
pub drivers_license: Option<DriversLicenseView>,
pub passport: Option<PassportView>,
pub favorite: bool,
pub reprompt: CipherRepromptType,
pub organization_use_totp: bool,
pub edit: bool,
pub permissions: Option<CipherPermissions>,
pub view_password: bool,
pub local_data: Option<LocalDataView>,
pub attachments: Option<Vec<AttachmentView>>,
pub attachment_decryption_failures: Option<Vec<AttachmentView>>,
pub fields: Option<Vec<FieldView>>,
pub password_history: Option<Vec<PasswordHistoryView>>,
pub creation_date: DateTime<Utc>,
pub deleted_date: Option<DateTime<Utc>>,
pub revision_date: DateTime<Utc>,
pub archived_date: Option<DateTime<Utc>>,
}Fields§
§id: Option<CipherId>§organization_id: Option<OrganizationId>§folder_id: Option<FolderId>§collection_ids: Vec<CollectionId>§key: Option<EncString>Temporary, required to support re-encrypting existing items.
name: String§notes: Option<String>§type: CipherType§login: Option<LoginView>§identity: Option<IdentityView>§card: Option<CardView>§secure_note: Option<SecureNoteView>§ssh_key: Option<SshKeyView>§bank_account: Option<BankAccountView>§drivers_license: Option<DriversLicenseView>§passport: Option<PassportView>§favorite: bool§reprompt: CipherRepromptType§organization_use_totp: bool§edit: bool§permissions: Option<CipherPermissions>§view_password: bool§local_data: Option<LocalDataView>§attachments: Option<Vec<AttachmentView>>§attachment_decryption_failures: Option<Vec<AttachmentView>>Attachments that failed to decrypt. Only present when there are decryption failures.
fields: Option<Vec<FieldView>>§password_history: Option<Vec<PasswordHistoryView>>§creation_date: DateTime<Utc>§deleted_date: Option<DateTime<Utc>>§revision_date: DateTime<Utc>§archived_date: Option<DateTime<Utc>>Implementations§
Source§impl CipherView
impl CipherView
pub fn generate_cipher_key( &mut self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, wrapping_key: SymmetricKeySlotId, ) -> Result<(), CryptoError>
pub fn generate_checksums(&mut self)
pub fn remove_invalid_checksums(&mut self)
fn reencrypt_attachment_keys( &mut self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, old_key: SymmetricKeySlotId, new_key: SymmetricKeySlotId, ) -> Result<(), CryptoError>
pub fn decrypt_fido2_credentials( &self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, ) -> Result<Vec<Fido2CredentialView>, CryptoError>
fn reencrypt_fido2_credentials( &mut self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, old_key: SymmetricKeySlotId, new_key: SymmetricKeySlotId, ) -> Result<(), CryptoError>
Sourcepub fn move_to_organization(
&mut self,
ctx: &mut KeyStoreContext<'_, KeySlotIds>,
organization_id: OrganizationId,
) -> Result<(), CipherError>
pub fn move_to_organization( &mut self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, organization_id: OrganizationId, ) -> Result<(), CipherError>
Moves the cipher to an organization by re-encrypting the cipher keys with the organization key and assigning the organization ID to the cipher.
§Arguments
ctx- The key store context where the cipher keys will be re-encryptedorganization_id- The ID of the organization to move the cipher to
Sourcepub fn reencrypt_cipher_keys(
&mut self,
ctx: &mut KeyStoreContext<'_, KeySlotIds>,
new_wrapping_key: SymmetricKeySlotId,
) -> Result<(), CipherError>
pub fn reencrypt_cipher_keys( &mut self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, new_wrapping_key: SymmetricKeySlotId, ) -> Result<(), CipherError>
Re-encrypt the cipher key(s) using a new wrapping key.
If the cipher has a cipher key, it will be re-encrypted with the new wrapping key. Otherwise, the cipher will re-encrypt all attachment keys and FIDO2 credential keys
pub fn set_new_fido2_credentials( &mut self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, creds: Vec<Fido2CredentialFullView>, ) -> Result<(), CipherError>
pub fn get_fido2_credentials( &self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, ) -> Result<Vec<Fido2CredentialFullView>, CipherError>
pub fn decrypt_fido2_private_key( &self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, ) -> Result<String, CipherError>
pub(crate) fn update_password_history(&mut self, original_cipher: &CipherView)
Sourcepub(crate) fn to_list_view(
&self,
ctx: &mut KeyStoreContext<'_, KeySlotIds>,
key: SymmetricKeySlotId,
) -> Result<CipherListView, CryptoError>
pub(crate) fn to_list_view( &self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, key: SymmetricKeySlotId, ) -> Result<CipherListView, CryptoError>
Projects this CipherView into a CipherListView.
Used by the blob decryption path: blob ciphers are fully unsealed to a
CipherView by decrypt_blob_cipher, and this method then derives the
list-view shape without re-decrypting any sensitive fields.
The login totp is re-encrypted under the cipher key because
LoginListView::totp stores an [EncString] (decrypted lazily via
CipherListView::get_totp_key); avoids a breaking change by keeping the
existing API contract
Sourcefn subtitle(&self) -> String
fn subtitle(&self) -> String
Derives the list-view subtitle from the decrypted view fields.
Mirrors the per-type logic that CipherKind::decrypt_subtitle runs against
encrypted fields, but operates on the already-decrypted view.
Sourcefn get_copyable_fields(&self) -> Vec<CopyableCipherFields>
fn get_copyable_fields(&self) -> Vec<CopyableCipherFields>
Derives copyable-field hints from the decrypted view fields.
Mirrors the per-type logic that CipherKind::get_copyable_fields runs on
encrypted types.
Trait Implementations§
Source§impl Clone for CipherView
impl Clone for CipherView
Source§fn clone(&self) -> CipherView
fn clone(&self) -> CipherView
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CompositeEncryptable<KeySlotIds, SymmetricKeySlotId, Cipher> for CipherView
impl CompositeEncryptable<KeySlotIds, SymmetricKeySlotId, Cipher> for CipherView
Source§impl<UT> ConvertError<UT> for CipherView
impl<UT> ConvertError<UT> for CipherView
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§impl Debug for CipherView
impl Debug for CipherView
Source§impl Decryptable<KeySlotIds, SymmetricKeySlotId, CipherView> for Cipher
impl Decryptable<KeySlotIds, SymmetricKeySlotId, CipherView> for Cipher
fn decrypt( &self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, key: SymmetricKeySlotId, ) -> Result<CipherView, CryptoError>
Source§impl Decryptable<KeySlotIds, SymmetricKeySlotId, CipherView> for StrictDecrypt<Cipher>
impl Decryptable<KeySlotIds, SymmetricKeySlotId, CipherView> for StrictDecrypt<Cipher>
fn decrypt( &self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, key: SymmetricKeySlotId, ) -> Result<CipherView, CryptoError>
Source§impl<'de> Deserialize<'de> for CipherView
impl<'de> Deserialize<'de> for CipherView
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<UT> FfiConverter<UT> for CipherView
impl<UT> FfiConverter<UT> for CipherView
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Source§impl From<CipherView> for JsValuewhere
CipherView: Serialize,
impl From<CipherView> for JsValuewhere
CipherView: Serialize,
Source§fn from(value: CipherView) -> Self
fn from(value: CipherView) -> Self
Source§impl FromWasmAbi for CipherViewwhere
Self: DeserializeOwned,
impl FromWasmAbi for CipherViewwhere
Self: DeserializeOwned,
Source§impl IdentifyKey<SymmetricKeySlotId> for CipherView
impl IdentifyKey<SymmetricKeySlotId> for CipherView
fn key_identifier(&self) -> SymmetricKeySlotId
Source§impl IntoWasmAbi for &CipherViewwhere
CipherView: Serialize,
impl IntoWasmAbi for &CipherViewwhere
CipherView: Serialize,
Source§impl IntoWasmAbi for CipherViewwhere
CipherView: Serialize,
impl IntoWasmAbi for CipherViewwhere
CipherView: Serialize,
Source§impl<UT> Lift<UT> for CipherView
impl<UT> Lift<UT> for CipherView
Source§impl<UT> LiftRef<UT> for CipherView
impl<UT> LiftRef<UT> for CipherView
type LiftType = CipherView
Source§impl<UT> LiftReturn<UT> for CipherView
impl<UT> LiftReturn<UT> for CipherView
Source§type ReturnType = <CipherView as Lift<UT>>::FfiType
type ReturnType = <CipherView as Lift<UT>>::FfiType
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Source§impl<UT> Lower<UT> for CipherView
impl<UT> Lower<UT> for CipherView
Source§impl<UT> LowerError<UT> for CipherView
impl<UT> LowerError<UT> for CipherView
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for CipherView
impl<UT> LowerReturn<UT> for CipherView
Source§type ReturnType = <CipherView as Lower<UT>>::FfiType
type ReturnType = <CipherView as Lower<UT>>::FfiType
Source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl OptionFromWasmAbi for CipherViewwhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for CipherViewwhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for CipherViewwhere
CipherView: Serialize,
impl OptionIntoWasmAbi for CipherViewwhere
CipherView: Serialize,
Source§impl RefFromWasmAbi for CipherViewwhere
Self: DeserializeOwned,
impl RefFromWasmAbi for CipherViewwhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
Self are recovered from.Source§type Anchor = SelfOwner<CipherView>
type Anchor = SelfOwner<CipherView>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl Serialize for CipherView
impl Serialize for CipherView
Source§impl TryFrom<CipherView> for CipherEditRequest
impl TryFrom<CipherView> for CipherEditRequest
Source§impl Tsify for CipherView
impl Tsify for CipherView
const DECL: &'static str = "export interface CipherView {\n id: CipherId | undefined;\n organizationId: OrganizationId | undefined;\n folderId: FolderId | undefined;\n collectionIds: CollectionId[];\n /**\n * Temporary, required to support re-encrypting existing items.\n */\n key: EncString | undefined;\n name: string;\n notes: string | undefined;\n type: CipherType;\n login: LoginView | undefined;\n identity: IdentityView | undefined;\n card: CardView | undefined;\n secureNote: SecureNoteView | undefined;\n sshKey: SshKeyView | undefined;\n bankAccount: BankAccountView | undefined;\n driversLicense: DriversLicenseView | undefined;\n passport: PassportView | undefined;\n favorite: boolean;\n reprompt: CipherRepromptType;\n organizationUseTotp: boolean;\n edit: boolean;\n permissions: CipherPermissions | undefined;\n viewPassword: boolean;\n localData: LocalDataView | undefined;\n attachments: AttachmentView[] | undefined;\n /**\n * Attachments that failed to decrypt. Only present when there are decryption failures.\n */\n attachmentDecryptionFailures?: AttachmentView[];\n fields: FieldView[] | undefined;\n passwordHistory: PasswordHistoryView[] | undefined;\n creationDate: DateTime<Utc>;\n deletedDate: DateTime<Utc> | undefined;\n revisionDate: DateTime<Utc>;\n archivedDate: DateTime<Utc> | undefined;\n}"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Source§impl<UT> TypeId<UT> for CipherView
impl<UT> TypeId<UT> for CipherView
const TYPE_ID_META: MetadataBuffer
Source§impl VectorFromWasmAbi for CipherViewwhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for CipherViewwhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for CipherViewwhere
CipherView: Serialize,
impl VectorIntoWasmAbi for CipherViewwhere
CipherView: Serialize,
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribe for CipherView
impl WasmDescribe for CipherView
Source§impl WasmDescribeVector for CipherView
impl WasmDescribeVector for CipherView
Auto Trait Implementations§
impl Freeze for CipherView
impl RefUnwindSafe for CipherView
impl Send for CipherView
impl Sync for CipherView
impl Unpin for CipherView
impl UnsafeUnpin for CipherView
impl UnwindSafe for CipherView
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.