pub struct CertsDir { /* private fields */ }Expand description
ノードの証明書のフォルダー。
Implementations§
Source§impl CertsDir
impl CertsDir
pub fn new(path: impl Into<PathBuf>, layout: Layout) -> Self
pub fn ca_certificate(&self) -> Result<Certificate, CertsDirError>
pub fn node_certificate(&self) -> Result<Certificate, CertsDirError>
Sourcepub fn ca_certificate_path(&self) -> PathBuf
pub fn ca_certificate_path(&self) -> PathBuf
CA の証明書のファイル。
Sourcepub fn node_certificate_path(&self) -> PathBuf
pub fn node_certificate_path(&self) -> PathBuf
ノードの証明書のファイル。
Sourcepub fn default_backup_dir(&self, now: SystemTime) -> Result<PathBuf>
pub fn default_backup_dir(&self, now: SystemTime) -> Result<PathBuf>
置き換える前のファイルをコピーしておく既定の場所。
フォルダーの隣の <フォルダーの名前>.<UTC の日時>.bak。
shoestring はフォルダーの中に決まったファイルしかないことを確かめるので、中には置かない。
Sourcepub fn replace_node_certificate(
&self,
certificate: &Certificate,
backup_dir: &Path,
) -> Result<(), CertsDirError>
pub fn replace_node_certificate( &self, certificate: &Certificate, backup_dir: &Path, ) -> Result<(), CertsDirError>
node.crt.pem と node.full.crt.pem を certificate に置き換える。
置き換える前に、certificate とフォルダーの CA の証明書が catapult の条件を満たすことを確かめ、
元の2つのファイルを同じ名前のまま backup_dir にコピーする。backup_dir にすでに同じ名前のファイルがあれば何もしない。
新しいファイルは同じフォルダーの一時ファイルに書いてから名前を変えるので、途中で失敗しても書きかけのファイルは残らない。
権限は元のファイルに合わせる。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CertsDir
impl RefUnwindSafe for CertsDir
impl Send for CertsDir
impl Sync for CertsDir
impl Unpin for CertsDir
impl UnsafeUnpin for CertsDir
impl UnwindSafe for CertsDir
Blanket Implementations§
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
Mutably borrows from an owned value. Read more