use std::collections::HashMap;
use rsa::rand_core::{OsRng, RngCore};
use crate::key::Key;
use crate::license_protocol::SignedDrmCertificate;
#[derive(Debug, Clone)]
pub struct Session {
pub number: u32,
pub id: Vec<u8>,
pub service_certificate: Option<SignedDrmCertificate>,
pub context: HashMap<Vec<u8>, (Vec<u8>, Vec<u8>)>,
pub keys: Vec<Key>,
}
impl Session {
#[must_use]
pub fn new(number: u32) -> Self {
let mut id = vec![0u8; 16];
let mut rng = OsRng;
rng.fill_bytes(&mut id);
Self {
number,
id,
service_certificate: None,
context: HashMap::new(),
keys: Vec::new(),
}
}
}