Skip to content

Commit

Permalink
Make oak_sdk_containers::crypto::InstanceSessionBinder public.
Browse files Browse the repository at this point in the history
Commit f6837fb dropped `pub mod crypto` from the Oak Containers SDK,
making the InstanceSessionBinder no longer public. It also made the
OrchestratorCryptoClient private, so it's no longer possible for
another crate to construct a InstanceSessionBinder. This change
therefore adds a new constructor method patterned after
InstanceEncryptionKeyHandle::create.

Change-Id: Ic802dd40b4ff26b53ce8155ac8c5845fdd347c21
  • Loading branch information
bmclarnon committed Mar 3, 2025
1 parent a44e24f commit d889956
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion oak_sdk/containers/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

pub use orchestrator_channel::default_orchestrator_channel;
pub use orchestrator_client::OrchestratorClient;
pub use orchestrator_crypto_client::InstanceEncryptionKeyHandle;
pub use orchestrator_crypto_client::{InstanceEncryptionKeyHandle, InstanceSessionBinder};
8 changes: 8 additions & 0 deletions oak_sdk/containers/orchestrator_crypto_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ pub struct InstanceSessionBinder {
}

impl InstanceSessionBinder {
pub fn create(orchestrator_channel: &tonic::transport::Channel) -> Self {
Self {
orchestrator_crypto_client: Arc::new(OrchestratorCryptoClient::create(
orchestrator_channel,
)),
}
}

async fn bind_session(&self, transcript: &[u8]) -> anyhow::Result<Signature> {
self.orchestrator_crypto_client
.bind_session(transcript, SESSION_BINDER_INFO_STRING.as_bytes())
Expand Down

0 comments on commit d889956

Please sign in to comment.