directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [1/5] directory-kerby git commit: Added some Javadoc
Date Mon, 04 Jan 2016 11:46:04 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/trunk 63dcb1a5a -> 82a7bdaa2


Added some Javadoc 

Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/a22b61aa
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/a22b61aa
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/a22b61aa

Branch: refs/heads/trunk
Commit: a22b61aa7d06eb804173a2f44901f915dd105cfa
Parents: 63dcb1a
Author: Emmanuel L├ęcharny <elecharny@symas.com>
Authored: Sun Jan 3 21:32:39 2016 +0100
Committer: Emmanuel L├ęcharny <elecharny@symas.com>
Committed: Sun Jan 3 21:32:39 2016 +0100

----------------------------------------------------------------------
 .../kerby/kerberos/kerb/type/ap/ApOption.java   | 40 +++++++++++++++-----
 .../kerby/kerberos/kerb/type/ap/ApOptions.java  | 31 ++++++++++++++-
 2 files changed, 61 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/a22b61aa/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApOption.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApOption.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApOption.java
index caf83a1..b39d2df 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApOption.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApOption.java
@@ -22,35 +22,57 @@ package org.apache.kerby.kerberos.kerb.type.ap;
 import org.apache.kerby.asn1.EnumType;
 
 /**
- APOptions       ::= KrbFlags
- -- reserved(0),
- -- use-session-key(1),
- -- mutual-required(2)
+ * The various APOptions values, as defined in RFC 4120.
+ * 
+ * <pre>
+ * APOptions       ::= KerberosFlags
+ *         -- reserved(0),
+ *         -- use-session-key(1),
+ *         -- mutual-required(2)
+ * </pre>
+ *         
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public enum ApOption implements EnumType {
     NONE(-1),
-    RESERVED(0x80000000),
-    USE_SESSION_KEY(0x40000000),
-    MUTUAL_REQUIRED(0x20000000),
-    ETYPE_NEGOTIATION(0x00000002),
-    USE_SUBKEY(0x00000001);
+    RESERVED(0x80000000),               // Bit 0, in ASN.1 BIT STRING definition : the most
left-handed bit 
+    USE_SESSION_KEY(0x40000000),        // Bit 1
+    MUTUAL_REQUIRED(0x20000000),        // Bit 2
+    ETYPE_NEGOTIATION(0x00000002),      // ???
+    USE_SUBKEY(0x00000001);             // ???
 
+    /** The internal value */
     private final int value;
 
+    /**
+     * Create a new enum 
+     */
     private ApOption(int value) {
         this.value = value;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public int getValue() {
         return value;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public String getName() {
         return name();
     }
 
+    /**
+     * Get the APOptions associated with a value.
+     * 
+     * @param value The integer value of the APOptions we are looking for
+     * @return The associated APOptions, or NONE if not found or if value is null
+     */
     public static ApOption fromValue(int value) {
         for (EnumType e : values()) {
             if (e.getValue() == value) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/a22b61aa/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApOptions.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApOptions.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApOptions.java
index a024734..2142c89 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApOptions.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApOptions.java
@@ -21,12 +21,41 @@ package org.apache.kerby.kerberos.kerb.type.ap;
 
 import org.apache.kerby.asn1.type.Asn1Flags;
 
+/**
+ * The APOptions container, as defined in RFC 4120 :
+ *  
+ * <pre>
+ * APOptions       ::= KerberosFlags
+ *         -- reserved(0),
+ *         -- use-session-key(1),
+ *         -- mutual-required(2)
+ * </pre>
+ * 
+ * The KerberosFlags element is defined as :
+ *
+ * <pre>
+ * KerberosFlags   ::= BIT STRING (SIZE (32..MAX))
+ *                  -- minimum number of bits shall be sent,
+ *                  -- but no fewer than 32
+ * </pre>
+ *
+ * which defines a 32 bits length for the BIT STRING (it may be longer, but for Kerberos,
it won't).
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public class ApOptions extends Asn1Flags {
-
+    /**
+     * Creates a default ApOptions container, with no bit set
+     */
     public ApOptions() {
         this(0);
     }
 
+    /**
+     * Set the flags into the container
+     * 
+     * @param value The flag as an integer
+     */
     public ApOptions(int value) {
         setFlags(value);
     }


Mime
View raw message