pub struct Cipher {Show 28 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: EncString,
pub notes: Option<EncString>,
pub type: CipherType,
pub login: Option<Login>,
pub identity: Option<Identity>,
pub card: Option<Card>,
pub secure_note: Option<SecureNote>,
pub ssh_key: Option<SshKey>,
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<LocalData>,
pub attachments: Option<Vec<Attachment>>,
pub fields: Option<Vec<Field>>,
pub password_history: Option<Vec<PasswordHistory>>,
pub creation_date: DateTime<Utc>,
pub deleted_date: Option<DateTime<Utc>>,
pub revision_date: DateTime<Utc>,
pub archived_date: Option<DateTime<Utc>>,
pub data: Option<String>,
}Fields§
§id: Option<CipherId>§organization_id: Option<OrganizationId>§folder_id: Option<FolderId>§collection_ids: Vec<CollectionId>§key: Option<EncString>More recent ciphers uses individual encryption keys to encrypt the other fields of the Cipher.
name: EncString§notes: Option<EncString>§type: CipherType§login: Option<Login>§identity: Option<Identity>§card: Option<Card>§secure_note: Option<SecureNote>§ssh_key: Option<SshKey>§favorite: bool§reprompt: CipherRepromptType§organization_use_totp: bool§edit: bool§permissions: Option<CipherPermissions>§view_password: bool§local_data: Option<LocalData>§attachments: Option<Vec<Attachment>>§fields: Option<Vec<Field>>§password_history: Option<Vec<PasswordHistory>>§creation_date: DateTime<Utc>§deleted_date: Option<DateTime<Utc>>§revision_date: DateTime<Utc>§archived_date: Option<DateTime<Utc>>§data: Option<String>Implementations§
Source§impl Cipher
impl Cipher
Sourcepub(super) fn decrypt_cipher_key(
ctx: &mut KeyStoreContext<'_, KeyIds>,
key: SymmetricKeyId,
ciphers_key: &Option<EncString>,
) -> Result<SymmetricKeyId, CryptoError>
pub(super) fn decrypt_cipher_key( ctx: &mut KeyStoreContext<'_, KeyIds>, key: SymmetricKeyId, ciphers_key: &Option<EncString>, ) -> Result<SymmetricKeyId, CryptoError>
Decrypt the individual encryption key for this cipher into the provided [KeyStoreContext] and return it’s identifier. Note that some ciphers do not have individual encryption keys, in which case this will return the provided key identifier instead
§Arguments
ctx- The key store context where the cipher key will be decrypted, if it existskey- The key to use to decrypt the cipher key, this should be the user or organization keyciphers_key- The encrypted cipher key
Sourcefn get_kind(&self) -> Option<&dyn CipherKind>
fn get_kind(&self) -> Option<&dyn CipherKind>
Temporary helper to return a CipherKind instance based on the cipher type.
Sourcefn decrypt_subtitle(
&self,
ctx: &mut KeyStoreContext<'_, KeyIds>,
key: SymmetricKeyId,
) -> Result<String, CryptoError>
fn decrypt_subtitle( &self, ctx: &mut KeyStoreContext<'_, KeyIds>, key: SymmetricKeyId, ) -> Result<String, CryptoError>
Returns the decrypted subtitle for the cipher, if applicable.
Sourcefn get_copyable_fields(&self) -> Vec<CopyableCipherFields>
fn get_copyable_fields(&self) -> Vec<CopyableCipherFields>
Returns a list of copyable field names for this cipher, based on the cipher type and populated properties.
Sourcepub(crate) fn populate_cipher_types(&mut self) -> Result<(), VaultParseError>
pub(crate) fn populate_cipher_types(&mut self) -> Result<(), VaultParseError>
This replaces the values provided by the API in the login, secure_note, card,
identity, and ssh_key fields, relying instead on client-side parsing of the
data field.
Sourcepub(crate) fn soft_delete(&mut self)
pub(crate) fn soft_delete(&mut self)
Marks the cipher as soft deleted by setting deletion_date to now.
Trait Implementations§
Source§impl CompositeEncryptable<KeyIds, SymmetricKeyId, Cipher> for CipherView
impl CompositeEncryptable<KeyIds, SymmetricKeyId, Cipher> for CipherView
Source§fn encrypt_composite(
&self,
ctx: &mut KeyStoreContext<'_, KeyIds>,
key: SymmetricKeyId,
) -> Result<Cipher, CryptoError>
fn encrypt_composite( &self, ctx: &mut KeyStoreContext<'_, KeyIds>, key: SymmetricKeyId, ) -> Result<Cipher, CryptoError>
Source§impl<UT> ConvertError<UT> for Cipher
impl<UT> ConvertError<UT> for Cipher
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§impl Decryptable<KeyIds, SymmetricKeyId, CipherListView> for Cipher
impl Decryptable<KeyIds, SymmetricKeyId, CipherListView> for Cipher
fn decrypt( &self, ctx: &mut KeyStoreContext<'_, KeyIds>, key: SymmetricKeyId, ) -> Result<CipherListView, CryptoError>
Source§impl Decryptable<KeyIds, SymmetricKeyId, CipherView> for Cipher
impl Decryptable<KeyIds, SymmetricKeyId, CipherView> for Cipher
fn decrypt( &self, ctx: &mut KeyStoreContext<'_, KeyIds>, key: SymmetricKeyId, ) -> Result<CipherView, CryptoError>
Source§impl<'de> Deserialize<'de> for Cipher
impl<'de> Deserialize<'de> for Cipher
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 Cipher
impl<UT> FfiConverter<UT> for Cipher
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 FromWasmAbi for Cipherwhere
Self: DeserializeOwned,
impl FromWasmAbi for Cipherwhere
Self: DeserializeOwned,
Source§impl IntoWasmAbi for Cipher
impl IntoWasmAbi for Cipher
Source§impl<UT> LiftReturn<UT> for Cipher
impl<UT> LiftReturn<UT> for Cipher
Source§type ReturnType = <Cipher as Lift<UT>>::FfiType
type ReturnType = <Cipher 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> LowerError<UT> for Cipher
impl<UT> LowerError<UT> for Cipher
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for Cipher
impl<UT> LowerReturn<UT> for Cipher
Source§type ReturnType = <Cipher as Lower<UT>>::FfiType
type ReturnType = <Cipher 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 Cipherwhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for Cipherwhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for Cipher
impl OptionIntoWasmAbi for Cipher
Source§impl RefFromWasmAbi for Cipherwhere
Self: DeserializeOwned,
impl RefFromWasmAbi for Cipherwhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
Self are recovered from.Source§impl Tsify for Cipher
impl Tsify for Cipher
const DECL: &'static str = "export interface Cipher {\n id: CipherId | undefined;\n organizationId: OrganizationId | undefined;\n folderId: FolderId | undefined;\n collectionIds: CollectionId[];\n /**\n * More recent ciphers uses individual encryption keys to encrypt the other fields of the\n * Cipher.\n */\n key: EncString | undefined;\n name: EncString;\n notes: EncString | undefined;\n type: CipherType;\n login: Login | undefined;\n identity: Identity | undefined;\n card: Card | undefined;\n secureNote: SecureNote | undefined;\n sshKey: SshKey | undefined;\n favorite: boolean;\n reprompt: CipherRepromptType;\n organizationUseTotp: boolean;\n edit: boolean;\n permissions: CipherPermissions | undefined;\n viewPassword: boolean;\n localData: LocalData | undefined;\n attachments: Attachment[] | undefined;\n fields: Field[] | undefined;\n passwordHistory: PasswordHistory[] | undefined;\n creationDate: DateTime<Utc>;\n deletedDate: DateTime<Utc> | undefined;\n revisionDate: DateTime<Utc>;\n archivedDate: DateTime<Utc> | undefined;\n data: string | 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 VectorFromWasmAbi for Cipherwhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for Cipherwhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for Cipher
impl VectorIntoWasmAbi for Cipher
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribeVector for Cipher
impl WasmDescribeVector for Cipher
impl Internal for Cipher
Auto Trait Implementations§
impl Freeze for Cipher
impl RefUnwindSafe for Cipher
impl Send for Cipher
impl Sync for Cipher
impl Unpin for Cipher
impl UnwindSafe for Cipher
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.