mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2025-02-09 13:14:46 +01:00
fix: Enable extra cli output for titlekeys (when using titlekey crypto)
This commit is contained in:
parent
300fa877e4
commit
3f5cd08b68
@ -65,6 +65,18 @@ public class Nca
|
|||||||
|
|
||||||
private static readonly string[] KakNames = { "application", "ocean", "system" };
|
private static readonly string[] KakNames = { "application", "ocean", "system" };
|
||||||
|
|
||||||
|
public byte[] GetEncryptedTitleKey()
|
||||||
|
{
|
||||||
|
var rightsId = new RightsId(Header.RightsId);
|
||||||
|
|
||||||
|
if (KeySet.ExternalKeySet.Get(rightsId, out AccessKey accessKey).IsFailure())
|
||||||
|
{
|
||||||
|
throw new MissingKeyException("Missing NCA title key.", rightsId.ToString(), KeyType.Title);
|
||||||
|
}
|
||||||
|
|
||||||
|
return accessKey.Value.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
public byte[] GetDecryptedTitleKey()
|
public byte[] GetDecryptedTitleKey()
|
||||||
{
|
{
|
||||||
int keyRevision = Utilities.GetMasterKeyRevision(Header.KeyGeneration);
|
int keyRevision = Utilities.GetMasterKeyRevision(Header.KeyGeneration);
|
||||||
|
@ -346,6 +346,8 @@ internal static class ProcessNca
|
|||||||
if (nca.Header.HasRightsId)
|
if (nca.Header.HasRightsId)
|
||||||
{
|
{
|
||||||
PrintItem(sb, colLen, "Rights ID:", nca.Header.RightsId.ToArray());
|
PrintItem(sb, colLen, "Rights ID:", nca.Header.RightsId.ToArray());
|
||||||
|
PrintItem(sb, colLen, "Titlekey (Encrypted):", nca.GetEncryptedTitleKey());
|
||||||
|
PrintItem(sb, colLen, "Titlekey (Decrypted):", nca.GetDecryptedTitleKey());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user