From 3d1b16691122adbc1742c326c95c873dfd0d0042 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Thu, 26 Aug 2021 20:40:36 +0200 Subject: [PATCH] Add comments --- openpgp-card/src/apdu/command.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openpgp-card/src/apdu/command.rs b/openpgp-card/src/apdu/command.rs index 8494b10..fe5886c 100644 --- a/openpgp-card/src/apdu/command.rs +++ b/openpgp-card/src/apdu/command.rs @@ -22,7 +22,13 @@ pub(crate) struct Command { } impl Command { + /// Create an APDU Command. + /// + /// `data` must be smaller than 64 kbyte. If a larger `data` is passed, + /// this fn will panic. pub fn new(cla: u8, ins: u8, p1: u8, p2: u8, data: Vec) -> Self { + // This constructor is the only place it gets set, so it's + // sufficient to check it here. assert!(data.len() < 0x10000, "'data' too big, must be <64 kbyte"); Command {