src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherReference.java
author redestad
Sat, 09 Dec 2017 03:33:39 +0100
changeset 49283 a14ede52a278
parent 47216 71c04702a3d5
permissions -rw-r--r--
8193128: Reduce number of implementation classes returned by List/Set/Map.of() 8191418: List.of().indexOf(null) doesn't throw NullPointerException Reviewed-by: smarks, jrose, martin, plevart
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 */
18780
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
     5
/**
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
     6
 * Licensed to the Apache Software Foundation (ASF) under one
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
     7
 * or more contributor license agreements. See the NOTICE file
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
     8
 * distributed with this work for additional information
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
     9
 * regarding copyright ownership. The ASF licenses this file
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    10
 * to you under the Apache License, Version 2.0 (the
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    11
 * "License"); you may not use this file except in compliance
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    12
 * with the License. You may obtain a copy of the License at
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 *
18780
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    14
 * http://www.apache.org/licenses/LICENSE-2.0
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 *
18780
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    16
 * Unless required by applicable law or agreed to in writing,
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    17
 * software distributed under the License is distributed on an
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    18
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    19
 * KIND, either express or implied. See the License for the
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    20
 * specific language governing permissions and limitations
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    21
 * under the License.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
package com.sun.org.apache.xml.internal.security.encryption;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
import org.w3c.dom.Attr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
/**
32275
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    28
 * {@code CipherReference} identifies a source which, when processed,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * yields the encrypted octet sequence.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * <p>
32275
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    31
 * The actual value is obtained as follows. The {@code CipherReference URI}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * contains an identifier that is dereferenced. Should the
32275
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    33
 * Transforms, the data resulting from dereferencing the {@code URI} is
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * transformed as specified so as to yield the intended cipher value. For
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * example, if the value is base64 encoded within an XML document; the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * transforms could specify an XPath expression followed by a base64 decoding so
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * as to extract the octets.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * <p>
32275
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    39
 * The syntax of the {@code URI} and Transforms is similar to that of
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * [XML-DSIG]. However, there is a difference between signature and encryption
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * processing. In [XML-DSIG] both generation and validation processing start
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * with the same source data and perform that transform in the same order. In
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * encryption, the decryptor has only the cipher data and the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * transforms are enumerated for the decryptor, in the order necessary to obtain
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * the octets. Consequently, because it has different semantics Transforms is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * the &xenc; namespace.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * The schema definition is as follows:
32275
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    49
 * <pre>{@code
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * <element name='CipherReference' type='xenc:CipherReferenceType'/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * <complexType name='CipherReferenceType'>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *     <sequence>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *         <element name='Transforms' type='xenc:TransformsType' minOccurs='0'/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *     </sequence>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 *     <attribute name='URI' type='anyURI' use='required'/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * </complexType>
32275
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    57
 * }</pre>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * @author Axl Mattheus
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
public interface CipherReference {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    /**
32275
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    63
     * Returns an {@code URI} that contains an identifier that should be
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * dereferenced.
32275
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    65
     * @return an {@code URI} that contains an identifier that should be
18780
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    66
     * dereferenced.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    String getURI();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
18780
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    70
    /**
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    71
     * Gets the URI as an Attribute node.  Used to meld the CipherReference
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    72
     * with the XMLSignature ResourceResolvers
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    73
     * @return the URI as an Attribute node
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    74
     */
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    75
    Attr getURIAsAttr();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    /**
32275
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    78
     * Returns the {@code Transforms} that specifies how to transform the
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    79
     * {@code URI} to yield the appropriate cipher value.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * @return the transform that specifies how to transform the reference to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     *   yield the intended cipher value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    Transforms getTransforms();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    /**
32275
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    87
     * Sets the {@code Transforms} that specifies how to transform the
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    88
     * {@code URI} to yield the appropriate cipher value.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     *
32275
17eeb583a331 8133802: replace some <tt> tags (obsolete in html5) in security-libs docs
avstepan
parents: 25859
diff changeset
    90
     * @param transforms the set of {@code Transforms} that specifies how
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     *   to transform the reference to yield the intended cipher value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    void setTransforms(Transforms transforms);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
}
18780
f47b920867e7 8011547: Update XML Signature implementation to Apache Santuario 1.5.4
mullan
parents: 2
diff changeset
    95