2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6 * ===========================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END====================================================
22 package org.onap.aaf.cadi.aaf.marshal;
24 import javax.xml.datatype.XMLGregorianCalendar;
26 import org.onap.aaf.misc.rosetta.marshal.FieldDateTime;
27 import org.onap.aaf.misc.rosetta.marshal.FieldHexBinary;
28 import org.onap.aaf.misc.rosetta.marshal.FieldString;
29 import org.onap.aaf.misc.rosetta.marshal.ObjMarshal;
31 import aaf.v2_0.Certs.Cert;
33 public class CertMarshal extends ObjMarshal<Cert> {
34 public CertMarshal() {
35 add(new FieldHexBinary<Cert>("fingerprint") {
37 protected byte[] data(Cert t) {
38 return t.getFingerprint();
42 add(new FieldString<Cert>("id") {
44 protected String data(Cert t) {
49 add(new FieldString<Cert>("x500") {
51 protected String data(Cert t) {
56 add(new FieldDateTime<Cert>("expires") {
58 protected XMLGregorianCalendar data(Cert t) {
59 return t.getExpires();