jdk/src/java.base/share/classes/sun/security/pkcs/ContentInfo.java
changeset 31426 9cd672654f97
parent 25859 3317bb8137f4
equal deleted inserted replaced
31425:276b895af81c 31426:9cd672654f97
     1 /*
     1 /*
     2  * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   161     public ObjectIdentifier getContentType() {
   161     public ObjectIdentifier getContentType() {
   162         return contentType;
   162         return contentType;
   163     }
   163     }
   164 
   164 
   165     public byte[] getData() throws IOException {
   165     public byte[] getData() throws IOException {
   166         if (contentType.equals((Object)DATA_OID) ||
   166         if (contentType.equals(DATA_OID) ||
   167             contentType.equals((Object)OLD_DATA_OID) ||
   167             contentType.equals(OLD_DATA_OID) ||
   168             contentType.equals((Object)TIMESTAMP_TOKEN_INFO_OID)) {
   168             contentType.equals(TIMESTAMP_TOKEN_INFO_OID)) {
   169             if (content == null)
   169             if (content == null)
   170                 return null;
   170                 return null;
   171             else
   171             else
   172                 return content.getOctetString();
   172                 return content.getOctetString();
   173         }
   173         }