Exemplo n.º 1
0
 public static AesKey EncryptTitleKey(ICbcModeEncryptor encryptor, ulong titleId, AesKey key)
 {
     byte[] numArray = new byte[key.Key.Length];
     byte[] rightsId = TicketUtility.CreateRightsId(titleId);
     encryptor.EncryptBlock(rightsId, key.Key, 0, key.Key.Length, numArray, 0);
     return(new AesKey(numArray));
 }
Exemplo n.º 2
0
 public XciHeaderSource(ref XciInfo xciInfo, XciMeta xciMeta, ISource rootPartitionFsHeaderHashSource, ICbcModeEncryptor headerEncryptor, ISigner headerSigner)
 {
     this.m_xciInfo = xciInfo;
     this.m_xciMeta = xciMeta;
     this.m_rootPartitionFsHeaderHashSource = rootPartitionFsHeaderHashSource;
     this.m_headerEncryptor = headerEncryptor;
     this.m_headerSigner    = headerSigner;
     this.Size = (long)(XciInfo.PageSize * XciInfo.CardHeaderPageCount);
 }
 private void SetCryptor(KeyConfiguration keyConfig)
 {
     this.m_keyAreaEncryptionKeyIvEncryptor = (IEncryptor) new Rsa2048OaepSha256CryptoDriver(Rsa2048OaepSha256KeyIndex.XciKeyArea);
     if (keyConfig.GetProdXciHeaderSignKey() != null)
     {
         RsaKey xciHeaderSignKey = keyConfig.GetProdXciHeaderSignKey();
         this.m_headerSigner = (ISigner) new Rsa2048Pkcs1Sha256SignCryptoDriver(xciHeaderSignKey.KeyModulus, xciHeaderSignKey.KeyPublicExponent, xciHeaderSignKey.KeyPrivateExponent);
     }
     else
     {
         this.m_headerSigner = (ISigner) new HsmRsa2048Pkcs1Sha256SignCryptoDriver(Rsa2048Pkcs1Sha256KeyIndex.XciHeader);
     }
     this.m_initialDataEncryptor = keyConfig.GetProdXciInitialDataEncryptionKey() == null ? (IEncryptor) new HsmAes128CryptoDriver(Aes128KeyIndex.XciInitialData) : (IEncryptor) new Aes128CryptoDriver(keyConfig.GetProdXciInitialDataEncryptionKey().Key);
     this.m_headerEncryptor      = (ICbcModeEncryptor) new Aes128CbcCryptoDriver(Aes128KeyIndex.XciHeader);
 }