2 * Copyright 2001-2007 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file saml/saml1/binding/SAMLArtifactType0001.h
20 * Type 0x0001 SAML 1.x artifact class
23 #ifndef __saml_artifacttype0001_h__
24 #define __saml_artifacttype0001_h__
26 #include <saml/binding/SAMLArtifact.h>
32 * Type 0x0001 SAML 1.x artifact class
34 class SAML_API SAMLArtifactType0001 : public SAMLArtifact
36 SAMLArtifactType0001& operator=(const SAMLArtifactType0001& src);
39 * Decodes a base64-encoded type 0x0001 artifact
41 * @param s NULL-terminated base64-encoded string
43 SAMLArtifactType0001(const char* s);
46 * Constructs an artifact with the specified source ID, but a random assertion handle.
48 * @param sourceid SOURCEID_LENGTH bytes of binary data
50 SAMLArtifactType0001(const std::string& sourceid);
53 * Constructs an artifact with the specified source ID and assertion handle.
55 * @param sourceid SOURCEID_LENGTH bytes of binary data
56 * @param handle HANDLE_LENGTH bytes of binary data
58 SAMLArtifactType0001(const std::string& sourceid, const std::string& handle);
60 virtual ~SAMLArtifactType0001() {}
62 virtual SAMLArtifactType0001* clone() const {
63 return new SAMLArtifactType0001(*this);
66 virtual std::string getSource() const {
67 return toHex(getSourceID());
71 * Returns the binary data that identifies the source.
72 * The result MAY contain embedded null characters.
74 * @return the binary source ID
76 virtual std::string getSourceID() const {
77 return m_raw.substr(TYPECODE_LENGTH,SOURCEID_LENGTH); // bytes 3-22
80 virtual std::string getMessageHandle() const {
81 return m_raw.substr(TYPECODE_LENGTH+SOURCEID_LENGTH, HANDLE_LENGTH); // bytes 23-42
84 /** Length of source ID */
85 static const unsigned int SOURCEID_LENGTH;
87 /** Length of assertion handle */
88 static const unsigned int HANDLE_LENGTH;
94 * @param src object to copy
96 SAMLArtifactType0001(const SAMLArtifactType0001& src) : SAMLArtifact(src) {}
102 #endif /* __saml_artifacttype0001_h__ */