Rev

Rev 1822 | Details | Compare with Previous | Last modification | View Log | SVN | Bug Tracker

Rev Author Line No. Line
1665 garciay 1
/**
2
 * @author      ETSI / STF481 / Yann Garcia
3
 * @version     $URL: file:///D:/RepositoriesNew/ITS/trunk/javasrc/codec/org/etsi/ttcn/codec/its/security/EncryptionParametersContainer.java $
4
 *              $Id: EncryptionParametersContainer.java 2655 2017-01-26 10:46:08Z filatov $
5
 */
1494 garciay 6
package org.etsi.ttcn.codec.its.security;
7
 
8
import org.etsi.ttcn.codec.CodecBuffer;
9
import org.etsi.ttcn.codec.MainCodec;
10
import org.etsi.ttcn.codec.generic.Union;
11
import org.etsi.ttcn.tci.OctetstringValue;
12
import org.etsi.ttcn.tci.UnionValue;
13
 
14
public class EncryptionParametersContainer extends Union {
15
 
16
    public EncryptionParametersContainer(MainCodec mainCodec) {
17
        super(mainCodec);
1510 garciay 18
        setLengths();
1494 garciay 19
    }
1510 garciay 20
 
21
    private void setLengths() {
22
        mainCodec.setHint("Oct12Len", "12");
23
    }
1494 garciay 24
 
25
    @Override
26
    protected void preEncode(CodecBuffer buf, UnionValue uv) {
2655 filatov 27
//        TERFactory.getInstance().logDebug(">>> EncryptionParametersContainer.preEncode: " + uv.getType().getName() + ", " + uv.getPresentVariantName());
1494 garciay 28
 
1510 garciay 29
        if (uv.getPresentVariantName().equals("params")) {
30
            buf.appendBytes(new byte[] { (byte)((OctetstringValue)(uv.getVariant(uv.getPresentVariantName()))).getLength() } );
31
        }
1494 garciay 32
    }
33
 
34
} // End of class EncryptionParametersContainer