jdk/src/java.security.jgss/share/classes/sun/security/krb5/Checksum.java
changeset 32003 acb12269398a
parent 25859 3317bb8137f4
equal deleted inserted replaced
32002:e378c0dc767e 32003:acb12269398a
   126         }
   126         }
   127     }
   127     }
   128 
   128 
   129     /**
   129     /**
   130      * Constructs a new Checksum using the raw data and type.
   130      * Constructs a new Checksum using the raw data and type.
   131      * @data the byte array of checksum.
   131      * @param data the byte array of checksum.
   132      * @new_cksumType the type of checksum.
   132      * @param new_cksumType the type of checksum.
   133      *
   133      *
   134      */
   134      */
   135          // used in InitialToken
   135          // used in InitialToken
   136     public Checksum(byte[] data, int new_cksumType) {
   136     public Checksum(byte[] data, int new_cksumType) {
   137         cksumType = new_cksumType;
   137         cksumType = new_cksumType;
   139     }
   139     }
   140 
   140 
   141     /**
   141     /**
   142      * Constructs a new Checksum by calculating the checksum over the data
   142      * Constructs a new Checksum by calculating the checksum over the data
   143      * using specified checksum type.
   143      * using specified checksum type.
   144      * @new_cksumType the type of checksum.
   144      * @param new_cksumType the type of checksum.
   145      * @data the data that needs to be performed a checksum calculation on.
   145      * @param data the data that needs to be performed a checksum calculation on.
   146      */
   146      */
   147     public Checksum(int new_cksumType, byte[] data)
   147     public Checksum(int new_cksumType, byte[] data)
   148         throws KdcErrException, KrbCryptoException {
   148         throws KdcErrException, KrbCryptoException {
   149 
   149 
   150         cksumType = new_cksumType;
   150         cksumType = new_cksumType;
   157     }
   157     }
   158 
   158 
   159     /**
   159     /**
   160      * Constructs a new Checksum by calculating the keyed checksum
   160      * Constructs a new Checksum by calculating the keyed checksum
   161      * over the data using specified checksum type.
   161      * over the data using specified checksum type.
   162      * @new_cksumType the type of checksum.
   162      * @param new_cksumType the type of checksum.
   163      * @data the data that needs to be performed a checksum calculation on.
   163      * @param data the data that needs to be performed a checksum calculation on.
   164      */
   164      */
   165          // KrbSafe, KrbTgsReq
   165          // KrbSafe, KrbTgsReq
   166     public Checksum(int new_cksumType, byte[] data,
   166     public Checksum(int new_cksumType, byte[] data,
   167                         EncryptionKey key, int usage)
   167                         EncryptionKey key, int usage)
   168         throws KdcErrException, KrbApErrException, KrbCryptoException {
   168         throws KdcErrException, KrbApErrException, KrbCryptoException {
   236         }
   236         }
   237     }
   237     }
   238 
   238 
   239     /**
   239     /**
   240      * Encodes a Checksum object.
   240      * Encodes a Checksum object.
   241      * <xmp>
   241      * <pre>{@code
   242      * Checksum    ::= SEQUENCE {
   242      * Checksum    ::= SEQUENCE {
   243      *         cksumtype   [0] Int32,
   243      *         cksumtype   [0] Int32,
   244      *         checksum    [1] OCTET STRING
   244      *         checksum    [1] OCTET STRING
   245      * }
   245      * }
   246      * </xmp>
   246      * }</pre>
   247      *
   247      *
   248      * <p>
   248      * <p>
   249      * This definition reflects the Network Working Group RFC 4120
   249      * This definition reflects the Network Working Group RFC 4120
   250      * specification available at
   250      * specification available at
   251      * <a href="http://www.ietf.org/rfc/rfc4120.txt">
   251      * <a href="http://www.ietf.org/rfc/rfc4120.txt">