directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [4/5] directory-kerby git commit: Added some Javadoc
Date Mon, 04 Jan 2016 11:46:07 GMT
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/1ccb0036
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/1ccb0036
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/1ccb0036

Branch: refs/heads/trunk
Commit: 1ccb0036ba5f2e91cf5215cf4f816ee9263f6000
Parents: 73ef82b
Author: Emmanuel L├ęcharny <elecharny@symas.com>
Authored: Sun Jan 3 23:01:53 2016 +0100
Committer: Emmanuel L├ęcharny <elecharny@symas.com>
Committed: Sun Jan 3 23:01:53 2016 +0100

----------------------------------------------------------------------
 .../kerberos/kerb/type/ap/Authenticator.java    | 106 +++++++++++++++++--
 1 file changed, 95 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1ccb0036/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/Authenticator.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/Authenticator.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/Authenticator.java
index 19b1ff2..3347fec 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/Authenticator.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/Authenticator.java
@@ -23,6 +23,7 @@ import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.asn1.type.Asn1Integer;
+import org.apache.kerby.kerberos.kerb.KrbConstant;
 import org.apache.kerby.kerberos.kerb.type.KerberosString;
 import org.apache.kerby.kerberos.kerb.type.KerberosTime;
 import org.apache.kerby.kerberos.kerb.type.KrbAppSequenceType;
@@ -32,21 +33,28 @@ import org.apache.kerby.kerberos.kerb.type.base.EncryptionKey;
 import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
 
 /**
- Authenticator   ::= [APPLICATION 2] SEQUENCE  {
- authenticator-vno       [0] INTEGER (5),
- crealm                  [1] Realm,
- cname                   [2] PrincipalName,
- cksum                   [3] Checksum OPTIONAL,
- cusec                   [4] Microseconds,
- ctime                   [5] KerberosTime,
- subkey                  [6] EncryptionKey OPTIONAL,
- seq-number              [7] UInt32 OPTIONAL,
- authorization-data      [8] AuthorizationData OPTIONAL
- }
+ * The definition of the unencrypted AUthenticator, per RFC 4120 :
+ * <pre>
+ * Authenticator   ::= [APPLICATION 2] SEQUENCE  {
+ *         authenticator-vno       [0] INTEGER (5),
+ *         crealm                  [1] Realm,
+ *         cname                   [2] PrincipalName,
+ *         cksum                   [3] Checksum OPTIONAL,
+ *         cusec                   [4] Microseconds,
+ *         ctime                   [5] KerberosTime,
+ *         subkey                  [6] EncryptionKey OPTIONAL,
+ *         seq-number              [7] UInt32 OPTIONAL,
+ *         authorization-data      [8] AuthorizationData OPTIONAL
+ * }
+ * </pre>
  */
 public class Authenticator extends KrbAppSequenceType {
+    /** The APPLICATION TAG */
     public static final int TAG = 2;
 
+    /**
+     * The possible fields
+     */
     protected enum AuthenticatorField implements EnumType {
         AUTHENTICATOR_VNO,
         CREALM,
@@ -58,17 +66,24 @@ public class Authenticator extends KrbAppSequenceType {
         SEQ_NUMBER,
         AUTHORIZATION_DATA;
 
+        /**
+         * {@inheritDoc}
+         */
         @Override
         public int getValue() {
             return ordinal();
         }
 
+        /**
+         * {@inheritDoc}
+         */
         @Override
         public String getName() {
             return name();
         }
     }
 
+    /** The ApReq's fields */
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
             new ExplicitField(AuthenticatorField.AUTHENTICATOR_VNO, Asn1Integer.class),
             new ExplicitField(AuthenticatorField.CREALM, KerberosString.class),
@@ -81,78 +96,147 @@ public class Authenticator extends KrbAppSequenceType {
             new ExplicitField(AuthenticatorField.AUTHORIZATION_DATA, AuthorizationData.class)
     };
 
+    /**
+     * Creates a new instance of an Authenticator
+     */
     public Authenticator() {
         super(TAG, fieldInfos);
+        
+        // Default to Version 5
+        setAuthenticatorVno(KrbConstant.KRB_V5);
     }
 
+    /**
+     * @return The Authenticator Version Number
+     */
     public int getAuthenticatorVno() {
         return getFieldAsInt(AuthenticatorField.AUTHENTICATOR_VNO);
     }
 
+    /**
+     * Sets the Authenticator version
+     * @param authenticatorVno The Authenticator version to store
+     */
     public void setAuthenticatorVno(int authenticatorVno) {
         setFieldAsInt(AuthenticatorField.AUTHENTICATOR_VNO, authenticatorVno);
     }
 
+    /**
+     * @return The Client Realm
+     */
     public String getCrealm() {
         return getFieldAsString(AuthenticatorField.CREALM);
     }
 
+    /**
+     * Sets the Client Realm
+     * @param crealm The Client Realm to store
+     */
     public void setCrealm(String crealm) {
         setFieldAsString(AuthenticatorField.CREALM, crealm);
     }
 
+    /**
+     * @return The client Principal's name
+     */
     public PrincipalName getCname() {
         return getFieldAs(AuthenticatorField.CNAME, PrincipalName.class);
     }
 
+    /**
+     * Sets the Client Principal's name
+     * @param crealm The Client Principal's name to store
+     */
     public void setCname(PrincipalName cname) {
         setFieldAs(AuthenticatorField.CNAME, cname);
     }
 
+    /**
+     * @return application data checksum
+     */
     public CheckSum getCksum() {
         return getFieldAs(AuthenticatorField.CKSUM, CheckSum.class);
     }
 
+    /**
+     * Sets the application data checksum
+     * @param cksum The application data checksum to store
+     */
     public void setCksum(CheckSum cksum) {
         setFieldAs(AuthenticatorField.CKSUM, cksum);
     }
 
+    /**
+     * @return The microsecond part of the client's timestamp
+     */
     public int getCusec() {
         return getFieldAsInt(AuthenticatorField.CUSEC);
     }
 
+    /**
+     * Sets the The microsecond part of the client's timestamp
+     * @param cusec The microsecond part of the client's timestamp to store
+     */
     public void setCusec(int cusec) {
         setFieldAsInt(AuthenticatorField.CUSEC, cusec);
     }
 
+    /**
+     * @return The client's host current time
+     */
     public KerberosTime getCtime() {
         return getFieldAsTime(AuthenticatorField.CTIME);
     }
 
+    /**
+     * Sets the client's host current time
+     * @param ctime The client's host current time to store
+     */
     public void setCtime(KerberosTime ctime) {
         setFieldAs(AuthenticatorField.CTIME, ctime);
     }
 
+    /**
+     * @return The client's encryption key
+     */
     public EncryptionKey getSubKey() {
         return getFieldAs(AuthenticatorField.SUBKEY, EncryptionKey.class);
     }
 
+    /**
+     * Sets the client's encryption key
+     * @param subKey The client's encryption key to store
+     */
     public void setSubKey(EncryptionKey subKey) {
         setFieldAs(AuthenticatorField.SUBKEY, subKey);
     }
 
+    /**
+     * @return The initial sequence number
+     */
     public int getSeqNumber() {
         return getFieldAsInt(AuthenticatorField.SEQ_NUMBER);
     }
 
+    /**
+     * Sets the initial sequence number
+     * @param seqNumber The initial sequence number to store
+     */
     public void setSeqNumber(Integer seqNumber) {
         setFieldAsInt(AuthenticatorField.SEQ_NUMBER, seqNumber);
     }
 
+    /**
+     * @return The stored Authorization-Data
+     */
     public AuthorizationData getAuthorizationData() {
         return getFieldAs(AuthenticatorField.AUTHORIZATION_DATA, AuthorizationData.class);
     }
 
+    /**
+     * Sets the stored Authorization-Data
+     * @param authorizationData The Authorization-Data to store
+     */
     public void setAuthorizationData(AuthorizationData authorizationData) {
         setFieldAs(AuthenticatorField.AUTHORIZATION_DATA, authorizationData);
     }


Mime
View raw message