diff --git a/pom.xml b/pom.xml index c3c70a9..f786c67 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.augustcellars.cose cose-java - 0.9.8-SNAPSHOT + 0.9.8 com.augustcellars.cose:cose-java A Java implementation that supports the COSE secure message specification. diff --git a/src/main/java/COSE/ASN1.java b/src/main/java/COSE/ASN1.java index 6820b98..fd3a4b7 100644 --- a/src/main/java/COSE/ASN1.java +++ b/src/main/java/COSE/ASN1.java @@ -62,9 +62,10 @@ public TagValue(int tagIn, ArrayList listIn) { * for the key * This function assumes that we are encoding an EC Public key.d * - * @param oid - encoded Object Identifier + * @param algorithm - encoded Object Identifier * @param keyBytes - encoded key bytes * @return - encoded SPKI + * @throws CoseException - ASN encoding error. */ public static byte[] EncodeSubjectPublicKeyInfo(byte[] algorithm, byte[] keyBytes) throws CoseException { @@ -96,8 +97,8 @@ public static byte[] EncodeSubjectPublicKeyInfo(byte[] algorithm, byte[] keyByte * @param oid - curve to use * @param keyBytes - bytes of the key * @param spki - optional SPKI - * @return - * @throws CoseException + * @return encoded private key + * @throws CoseException - from lower level */ public static byte[] EncodeEcPrivateKey(byte[] oid, byte[] keyBytes, byte[] spki) throws CoseException { @@ -170,7 +171,7 @@ public static ArrayList DecodeSubjectPublicKeyInfo(byte[] encoding) th * @param offset - starting offset in array to begin decoding * @param encoding - bytes of the ASN.1 encoded value * @return Decoded structure - * @throws CoseException + * @throws CoseException - ASN.1 encoding errors */ public static TagValue DecodeCompound(int offset, byte[] encoding) throws CoseException { @@ -214,11 +215,11 @@ public static TagValue DecodeCompound(int offset, byte[] encoding) throws CoseEx /** * Encode a private key into a PKCS#8 private key structure. * - * @param oid - EC curve OID + * @param algorithm - EC curve OID * @param keyBytes - raw bytes of the key * @param spki - optional subject public key info structure to include * @return byte array of encoded bytes - * @throws CoseException + * @throws CoseException - ASN.1 encoding errors */ public static byte[] EncodePKCS8(byte[] algorithm, byte[] keyBytes, byte[] spki) throws CoseException { @@ -255,7 +256,7 @@ public static byte[] EncodePKCS8(byte[] algorithm, byte[] keyBytes, byte[] spki) * * @param encodedData bytes containing the private key * @return tag/value from the decoded object - * @throws CoseException + * @throws CoseException - ASN.1 encoding errors */ public static ArrayList DecodePKCS8(byte[] encodedData) throws CoseException { diff --git a/src/main/java/COSE/Attribute.java b/src/main/java/COSE/Attribute.java index a23fe88..f67c0c8 100644 --- a/src/main/java/COSE/Attribute.java +++ b/src/main/java/COSE/Attribute.java @@ -344,7 +344,7 @@ public void removeAttribute(CBORObject label) throws CoseException { * Remove an attribute from the set of all attribute maps. * * @param label attribute to be removed - * @throws CoseException + * @throws CoseException - Label not present */ public void removeAttribute(HeaderKeys label) throws CoseException { removeAttribute(label.AsCBOR()); @@ -353,7 +353,7 @@ public void removeAttribute(HeaderKeys label) throws CoseException { /** * Get the optional external data field to be authenticated * - * * @return external authenticated data + * @return external authenticated data */ public byte[] getExternal() { return externalData; diff --git a/src/main/java/COSE/Encrypt0Message.java b/src/main/java/COSE/Encrypt0Message.java index 882b727..f3b5733 100644 --- a/src/main/java/COSE/Encrypt0Message.java +++ b/src/main/java/COSE/Encrypt0Message.java @@ -90,7 +90,7 @@ protected CBORObject EncodeCBORObject() throws CoseException { * * @param rgbKey key for decryption * @return the decrypted content - * @throws CoseException + * @throws CoseException - Error during decryption */ public byte[] decrypt(byte[] rgbKey) throws CoseException { return super.decryptWithKey(rgbKey); @@ -100,8 +100,8 @@ public byte[] decrypt(byte[] rgbKey) throws CoseException { * Encrypt the message using the passed in key. * * @param rgbKey key used for encryption - * @throws CoseException - * @throws IllegalStateException + * @throws CoseException - Error during decryption + * @throws IllegalStateException - Error during decryption */ public void encrypt(byte[] rgbKey) throws CoseException, IllegalStateException { super.encryptWithKey(rgbKey); diff --git a/src/main/java/COSE/Signer.java b/src/main/java/COSE/Signer.java index 39b7195..e2c3892 100644 --- a/src/main/java/COSE/Signer.java +++ b/src/main/java/COSE/Signer.java @@ -55,6 +55,7 @@ public void clearKey() { * * @since COSE 0.9.1 * @param keyIn key to be used for signing or verification + * @throws CoseException - Invalid key passed in */ public void setKey(OneKey keyIn) throws CoseException { setupKey(keyIn); @@ -64,7 +65,7 @@ public void setKey(OneKey keyIn) throws CoseException { * Set the key on the object, if there is not a signature on this object then set * the algorithm and the key id from the key if they exist on the key and do not exist in the message. * - * @param key key to be used + * @param key key to be used] */ private void setupKey(OneKey key) throws CoseException { CBORObject cn2;