You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: codec.rs
    path of file: ./repos/CYFS/src/component/cyfs-stack/src/crypto_api/local
    
    the code of the file until where you have to start completion: use crate::zone::*;
use cyfs_base::*;
use cyfs_bdt::StackGuard;
use cyfs_lib::*;

use std::borrow::Cow;

pub struct CryptoCodec {
    bdt_stack: StackGuard,
    zone_manager: ZoneManagerRef,
}

impl CryptoCodec {
    pub(crate) fn new(zone_manager: ZoneManagerRef, bdt_stack: StackGuard) -> Self {
        Sel
    
    async fn get_sk(&self, flags: u32) -> BuckyResult<Option<Cow<PrivateKey>>> {
        if flags & CRYPTO_REQUEST_FLAG_CRYPT_BY_OWNER != 0 {
            Ok(None)
        } else if flags & CRYPTO_REQUEST_FLAG_CRYPT_BY_DEVICE != 0 {
            Ok(Some(Cow::Borrowed(self.bdt_stack.keystore().private_key())))
        } else {
            let msg = format!(
                "invalid decrypt data flags, decrypt data only support by device/owner! flags={}",
                flags
            );
            error!("{}", msg);
            Err(BuckyError::new(BuckyErrorCode::InvalidParam, msg))
        }
    }