Code example for Enumeration

Methods: hasMoreElements, nextElement

0
    public PBKDF2Params( 
        ASN1Sequence  seq)
    { 
        Enumeration e = seq.getObjects();
 
        octStr = (ASN1OctetString)e.nextElement();
        iterationCount = (DERInteger)e.nextElement();
 
        if (e.hasMoreElements())
        { 
            keyLength = (DERInteger)e.nextElement();
        } 
        else 
        { 
            keyLength = null;
        } 
    } 
 
    public byte[] getSalt() 
    { 
        return octStr.getOctets();