FileDocCategorySizeDatePackage
ASN1UTCTime.javaAPI DocAndroid 1.5 API3523Wed May 06 22:41:06 BST 2009org.apache.harmony.security.asn1

ASN1UTCTime

public class ASN1UTCTime extends ASN1Time
This class represents ASN.1 UTCTime type According to X.680 specification this type is defined as follows: UTCTime ::= [UNIVERSAL 23] IMPLICIT VisibleString
see
ASN.1

Fields Summary
public static final int
UTC_HM
Length for the pattern: YYMMDDhhmm'Z'
public static final int
UTC_HMS
Length for the pattern: YYMMDDhhmmss'Z'
public static final int
UTC_LOCAL_HM
Length for the pattern: YYMMDDhhmm('+'/'-')hhmm
public static final int
UTC_LOCAL_HMS
Length for the pattern: YYMMDDhhmmss('+'/'-')hhmm
private static final ASN1UTCTime
ASN1
private static final String
UTC_PATTERN
Constructors Summary
public ASN1UTCTime()
Constructs ASN.1 UTCTime type The constructor is provided for inheritance purposes when there is a need to create a custom ASN.1 UTCTime type. To get a default implementation it is recommended to use getInstance() method.


                                             
      
        super(TAG_UTCTIME);
    
Methods Summary
public java.lang.Objectdecode(BerInputStream in)

        in.readUTCTime();

        if (in.isVerify) {
            return null;
        }
        return getDecodedObject(in);
    
public voidencodeContent(BerOutputStream out)

        out.encodeUTCTime();
    
public static org.apache.harmony.security.asn1.ASN1UTCTimegetInstance()
Returns ASN.1 UTCTime type default implementation The default implementation works with encoding that is represented as Date object.

return
ASN.1 UTCTime type default implementation

        return ASN1;
    
public voidsetEncodingContent(BerOutputStream out)

 //$NON-NLS-1$

        
        SimpleDateFormat sdf = new SimpleDateFormat(UTC_PATTERN);
        sdf.setTimeZone(TimeZone.getTimeZone("UTC")); //$NON-NLS-1$
        out.content = sdf.format(out.content).getBytes();
        out.length = ((byte[]) out.content).length;