pub struct CipherView {Show 32 fields
pub id: Option<CipherId>,
pub organization_id: Option<OrganizationId>,
pub folder_id: Option<FolderId>,
pub collection_ids: Vec<CollectionId>,
pub key: Option<SymmetricCryptoKey>,
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>>,
pub partial: bool,
}Fields§
§id: Option<CipherId>§organization_id: Option<OrganizationId>§folder_id: Option<FolderId>§collection_ids: Vec<CollectionId>§key: Option<SymmetricCryptoKey>§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>>§partial: boolTrue when this view was produced from a server-restricted (PAM-gated) cipher. Only a
sub-set of fields are populated; every secret field is absent. See
Cipher::partial_data.
Such a view is fail-closed against re-encryption: passing it to any encrypt path returns
[bitwarden_crypto::CryptoError::EncryptRestrictedView] rather than silently stripping
secrets.
Implementations§
Source§impl CipherView
Item Send payloads: the sealed blob is the entire data string of an Item Send, sealed
directly under the send key. It has no outer cipher key and no metadata; only the blob
contents (name, notes, type data, fields, password history) round-trip.
impl CipherView
Item Send payloads: the sealed blob is the entire data string of an Item Send, sealed
directly under the send key. It has no outer cipher key and no metadata; only the blob
contents (name, notes, type data, fields, password history) round-trip.
CipherView --seal_blob_for_item_sends(send key)--> SendItem.data (opaque string)
SendItem.data --unseal_blob_for_item_sends(send key)--> CipherView (metadata defaulted)Sourcepub fn seal_blob_for_item_sends(
&self,
ctx: &mut KeyStoreContext<'_, KeySlotIds>,
key: SymmetricKeySlotId,
) -> Result<String, CryptoError>
pub fn seal_blob_for_item_sends( &self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, key: SymmetricKeySlotId, ) -> Result<String, CryptoError>
Seals the sensitive contents of this view into an opaque blob string under key.
Sourcepub fn unseal_blob_for_item_sends(
data: &str,
ctx: &mut KeyStoreContext<'_, KeySlotIds>,
key: SymmetricKeySlotId,
) -> Result<CipherView, CryptoError>
pub fn unseal_blob_for_item_sends( data: &str, ctx: &mut KeyStoreContext<'_, KeySlotIds>, key: SymmetricKeySlotId, ) -> Result<CipherView, CryptoError>
Unseals a blob produced by CipherView::seal_blob_for_item_sends. Metadata absent
from the blob (ids, dates, flags) is set to defaults; the type follows the blob contents.
Source§impl CipherView
impl CipherView
fn encrypt_legacy_field_encryption( &mut self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, key: SymmetricKeySlotId, ) -> Result<Cipher, CryptoError>
Source§impl CipherView
impl CipherView
Sourcepub fn load_cipher_key_slot(
&mut self,
ctx: &mut KeyStoreContext<'_, KeySlotIds>,
) -> Result<SymmetricKeySlotId, CryptoError>
pub fn load_cipher_key_slot( &mut self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, ) -> Result<SymmetricKeySlotId, CryptoError>
Returns the context slot holding the cipher’s own key, generating and storing one if the view doesn’t have it yet. Every cipher the SDK encrypts carries its own key.
pub fn generate_checksums(&mut self)
pub fn remove_invalid_checksums(&mut self)
pub fn get_fido2_credentials(&self) -> Vec<Fido2CredentialView>
Sourcepub fn move_to_organization(
&mut self,
organization_id: OrganizationId,
) -> Result<(), CipherError>
pub fn move_to_organization( &mut self, organization_id: OrganizationId, ) -> Result<(), CipherError>
Moves the cipher to an organization by assigning the organization ID to the cipher.
§Arguments
organization_id- The ID of the organization to move the cipher to
Sourcepub fn validate_attachment_keys(&mut self) -> Result<(), CipherError>
pub fn validate_attachment_keys(&mut self) -> Result<(), CipherError>
Validates that all attachments have keys, returning an error if any are missing.
Key re-wrapping under the new wrapping key happens at encrypt time inside
CompositeEncryptable / encrypt_legacy_field_encryption.
pub fn set_new_fido2_credentials( &mut self, creds: Vec<Fido2CredentialFullView>, ) -> Result<(), CipherError>
pub(crate) fn update_password_history(&mut self, original_cipher: &CipherView)
Sourcepub(crate) fn to_list_view(&self) -> Result<CipherListView, CryptoError>
pub(crate) fn to_list_view(&self) -> 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.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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
Source§fn decrypt(
&self,
ctx: &mut KeyStoreContext<'_, KeySlotIds>,
key: SymmetricKeySlotId,
) -> Result<CipherView, CryptoError>
fn decrypt( &self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, key: SymmetricKeySlotId, ) -> Result<CipherView, CryptoError>
self into an Output under key. See the trait-level contract: the result must
contain no cipher text.Source§impl Decryptable<KeySlotIds, SymmetricKeySlotId, CipherView> for StrictDecrypt<Cipher>
impl Decryptable<KeySlotIds, SymmetricKeySlotId, CipherView> for StrictDecrypt<Cipher>
Source§fn decrypt(
&self,
ctx: &mut KeyStoreContext<'_, KeySlotIds>,
key: SymmetricKeySlotId,
) -> Result<CipherView, CryptoError>
fn decrypt( &self, ctx: &mut KeyStoreContext<'_, KeySlotIds>, key: SymmetricKeySlotId, ) -> Result<CipherView, CryptoError>
self into an Output under key. See the trait-level contract: the result must
contain no cipher text.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 PartialEq for CipherView
impl PartialEq for CipherView
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
impl StructuralPartialEq 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 key: SymmetricKey | 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 /**\n * True when this view was produced from a server-restricted (PAM-gated) cipher. Only a\n * sub-set of fields are populated; every secret field is absent. See\n * [`Cipher::partial_data`].\n * Such a view is fail-closed against re-encryption: passing it to any encrypt path returns\n * [`bitwarden_crypto::CryptoError::EncryptRestrictedView`] rather than silently stripping\n * secrets.\n */\n partial?: boolean;\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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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> ⓘ
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 moreimpl<T> Persist for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> 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.